hostinger-api-sdk 1.68.0 → 2.1.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.
Files changed (41) hide show
  1. package/README.md +2 -2
  2. package/api.ts +324 -20
  3. package/base.ts +1 -1
  4. package/common.ts +1 -1
  5. package/configuration.ts +2 -2
  6. package/dist/api.d.ts +272 -21
  7. package/dist/api.js +127 -22
  8. package/dist/base.d.ts +1 -1
  9. package/dist/base.js +1 -1
  10. package/dist/common.d.ts +1 -1
  11. package/dist/common.js +1 -1
  12. package/dist/configuration.d.ts +1 -1
  13. package/dist/configuration.js +2 -2
  14. package/dist/esm/api.d.ts +272 -21
  15. package/dist/esm/api.js +118 -13
  16. package/dist/esm/base.d.ts +1 -1
  17. package/dist/esm/base.js +1 -1
  18. package/dist/esm/common.d.ts +1 -1
  19. package/dist/esm/common.js +1 -1
  20. package/dist/esm/configuration.d.ts +1 -1
  21. package/dist/esm/configuration.js +2 -2
  22. package/dist/esm/index.d.ts +1 -1
  23. package/dist/esm/index.js +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/docs/EcommerceProductVariantsApi.md +1 -1
  27. package/docs/EcommerceProductsApi.md +1 -1
  28. package/docs/EcommerceV1ProductCreatePhysicalProductRequest.md +2 -0
  29. package/docs/EcommerceV1ProductCreatePhysicalProductRequestSeoSettings.md +25 -0
  30. package/docs/EcommerceV1ProductUpdateRequest.md +4 -0
  31. package/docs/EcommerceV1ProductUpdateRequestCollectionChanges.md +23 -0
  32. package/docs/EcommerceV1ProductUpdateRequestCollectionChangesAddInner.md +20 -0
  33. package/docs/EcommerceV1ProductUpdateRequestSeoSettings.md +25 -0
  34. package/docs/EcommerceV1VariantBatchUpdateVariantsRequestVariantsInner.md +2 -0
  35. package/docs/WordPressAIContentApi.md +70 -3
  36. package/docs/WordPressV1ContentGeneratedImageResource.md +27 -0
  37. package/docs/WordPressV1ContentGeneratedImagesResource.md +3 -3
  38. package/docs/WordPressV1ContentGenerationResource.md +27 -0
  39. package/docs/WordPressV1ContentGenerationResourceResult.md +23 -0
  40. package/index.ts +1 -1
  41. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- ## @hostinger/sdk@1.68.0
1
+ ## @hostinger/sdk@2.1.0
2
2
 
3
3
  For more information, please visit [https://developers.hostinger.com](https://developers.hostinger.com).
4
4
 
5
5
  ### Usage
6
6
 
7
7
  ```
8
- npm install @hostinger/sdk@1.68.0 --save
8
+ npm install @hostinger/sdk@2.1.0 --save
9
9
  ```
package/api.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.68.0
6
+ * API Version: 2.1.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
@@ -5424,6 +5424,37 @@ export interface EcommerceV1ProductCreatePhysicalProductRequest {
5424
5424
  * @memberof EcommerceV1ProductCreatePhysicalProductRequest
5425
5425
  */
5426
5426
  'currency': string | null;
5427
+ /**
5428
+ *
5429
+ * @type {EcommerceV1ProductCreatePhysicalProductRequestSeoSettings}
5430
+ * @memberof EcommerceV1ProductCreatePhysicalProductRequest
5431
+ */
5432
+ 'seo_settings': EcommerceV1ProductCreatePhysicalProductRequestSeoSettings;
5433
+ }
5434
+ /**
5435
+ * Search-engine settings. Omitted fields are generated from the name and description; a slug already in use gets a numeric suffix. Send at least one field.
5436
+ * @export
5437
+ * @interface EcommerceV1ProductCreatePhysicalProductRequestSeoSettings
5438
+ */
5439
+ export interface EcommerceV1ProductCreatePhysicalProductRequestSeoSettings {
5440
+ /**
5441
+ * Search-engine title for the product page.
5442
+ * @type {string}
5443
+ * @memberof EcommerceV1ProductCreatePhysicalProductRequestSeoSettings
5444
+ */
5445
+ 'title': string;
5446
+ /**
5447
+ * Search-engine description for the product page.
5448
+ * @type {string}
5449
+ * @memberof EcommerceV1ProductCreatePhysicalProductRequestSeoSettings
5450
+ */
5451
+ 'description': string;
5452
+ /**
5453
+ * URL slug of the product page. Lowercase letters, digits and dashes.
5454
+ * @type {string}
5455
+ * @memberof EcommerceV1ProductCreatePhysicalProductRequestSeoSettings
5456
+ */
5457
+ 'slug': string;
5427
5458
  }
5428
5459
  /**
5429
5460
  *
@@ -5835,6 +5866,18 @@ export interface EcommerceV1ProductUpdateRequest {
5835
5866
  * @memberof EcommerceV1ProductUpdateRequest
5836
5867
  */
5837
5868
  'status': EcommerceV1ProductUpdateRequestStatusEnum;
5869
+ /**
5870
+ *
5871
+ * @type {EcommerceV1ProductUpdateRequestSeoSettings}
5872
+ * @memberof EcommerceV1ProductUpdateRequest
5873
+ */
5874
+ 'seo_settings': EcommerceV1ProductUpdateRequestSeoSettings;
5875
+ /**
5876
+ *
5877
+ * @type {EcommerceV1ProductUpdateRequestCollectionChanges}
5878
+ * @memberof EcommerceV1ProductUpdateRequest
5879
+ */
5880
+ 'collection_changes': EcommerceV1ProductUpdateRequestCollectionChanges;
5838
5881
  }
5839
5882
 
5840
5883
  export const EcommerceV1ProductUpdateRequestStatusEnum = {
@@ -5845,6 +5888,63 @@ export const EcommerceV1ProductUpdateRequestStatusEnum = {
5845
5888
 
5846
5889
  export type EcommerceV1ProductUpdateRequestStatusEnum = typeof EcommerceV1ProductUpdateRequestStatusEnum[keyof typeof EcommerceV1ProductUpdateRequestStatusEnum];
5847
5890
 
5891
+ /**
5892
+ * Adds the product to or removes it from collections without touching its other collections. Send at least one collection in add or remove.
5893
+ * @export
5894
+ * @interface EcommerceV1ProductUpdateRequestCollectionChanges
5895
+ */
5896
+ export interface EcommerceV1ProductUpdateRequestCollectionChanges {
5897
+ /**
5898
+ * Collections to add the product to. Every id must exist in the store.
5899
+ * @type {Array<EcommerceV1ProductUpdateRequestCollectionChangesAddInner>}
5900
+ * @memberof EcommerceV1ProductUpdateRequestCollectionChanges
5901
+ */
5902
+ 'add': Array<EcommerceV1ProductUpdateRequestCollectionChangesAddInner>;
5903
+ /**
5904
+ * Collections to take the product out of. Ids the product is not in are ignored.
5905
+ * @type {Array<EcommerceV1ProductUpdateRequestCollectionChangesAddInner>}
5906
+ * @memberof EcommerceV1ProductUpdateRequestCollectionChanges
5907
+ */
5908
+ 'remove': Array<EcommerceV1ProductUpdateRequestCollectionChangesAddInner>;
5909
+ }
5910
+ /**
5911
+ *
5912
+ * @export
5913
+ * @interface EcommerceV1ProductUpdateRequestCollectionChangesAddInner
5914
+ */
5915
+ export interface EcommerceV1ProductUpdateRequestCollectionChangesAddInner {
5916
+ /**
5917
+ * The collection id.
5918
+ * @type {string}
5919
+ * @memberof EcommerceV1ProductUpdateRequestCollectionChangesAddInner
5920
+ */
5921
+ 'id': string;
5922
+ }
5923
+ /**
5924
+ * Search-engine settings to change. Send at least one field; omitted fields keep their current values.
5925
+ * @export
5926
+ * @interface EcommerceV1ProductUpdateRequestSeoSettings
5927
+ */
5928
+ export interface EcommerceV1ProductUpdateRequestSeoSettings {
5929
+ /**
5930
+ * Search-engine title for the product page.
5931
+ * @type {string}
5932
+ * @memberof EcommerceV1ProductUpdateRequestSeoSettings
5933
+ */
5934
+ 'title': string;
5935
+ /**
5936
+ * Search-engine description for the product page.
5937
+ * @type {string}
5938
+ * @memberof EcommerceV1ProductUpdateRequestSeoSettings
5939
+ */
5940
+ 'description': string;
5941
+ /**
5942
+ * URL slug of the product page. Lowercase letters, digits and dashes.
5943
+ * @type {string}
5944
+ * @memberof EcommerceV1ProductUpdateRequestSeoSettings
5945
+ */
5946
+ 'slug': string;
5947
+ }
5848
5948
  /**
5849
5949
  *
5850
5950
  * @export
@@ -6506,6 +6606,12 @@ export interface EcommerceV1VariantBatchUpdateVariantsRequestVariantsInner {
6506
6606
  * @memberof EcommerceV1VariantBatchUpdateVariantsRequestVariantsInner
6507
6607
  */
6508
6608
  'title': string;
6609
+ /**
6610
+ * The variant SKU.
6611
+ * @type {string}
6612
+ * @memberof EcommerceV1VariantBatchUpdateVariantsRequestVariantsInner
6613
+ */
6614
+ 'sku': string;
6509
6615
  /**
6510
6616
  * Units in stock.
6511
6617
  * @type {number}
@@ -17112,6 +17218,37 @@ export const WordPressV1ContentGenerateImagesRequestImageTypeEnum = {
17112
17218
 
17113
17219
  export type WordPressV1ContentGenerateImagesRequestImageTypeEnum = typeof WordPressV1ContentGenerateImagesRequestImageTypeEnum[keyof typeof WordPressV1ContentGenerateImagesRequestImageTypeEnum];
17114
17220
 
17221
+ /**
17222
+ * Single image generated by the AI image generator.
17223
+ * @export
17224
+ * @interface WordPressV1ContentGeneratedImageResource
17225
+ */
17226
+ export interface WordPressV1ContentGeneratedImageResource {
17227
+ /**
17228
+ * Temporary URL of the generated image, valid until the `expires_at` time of the result
17229
+ * @type {string}
17230
+ * @memberof WordPressV1ContentGeneratedImageResource
17231
+ */
17232
+ 'url': string;
17233
+ /**
17234
+ * Image width in pixels
17235
+ * @type {number}
17236
+ * @memberof WordPressV1ContentGeneratedImageResource
17237
+ */
17238
+ 'width': number;
17239
+ /**
17240
+ * Image height in pixels
17241
+ * @type {number}
17242
+ * @memberof WordPressV1ContentGeneratedImageResource
17243
+ */
17244
+ 'height': number;
17245
+ /**
17246
+ * MIME type of the image
17247
+ * @type {string}
17248
+ * @memberof WordPressV1ContentGeneratedImageResource
17249
+ */
17250
+ 'content_type': string;
17251
+ }
17115
17252
  /**
17116
17253
  * Images generated by the AI image generator.
17117
17254
  * @export
@@ -17119,17 +17256,82 @@ export type WordPressV1ContentGenerateImagesRequestImageTypeEnum = typeof WordPr
17119
17256
  */
17120
17257
  export interface WordPressV1ContentGeneratedImagesResource {
17121
17258
  /**
17122
- * Generated images, each encoded as a base64 string
17123
- * @type {Array<string>}
17259
+ * Generated images, each available at a temporary URL
17260
+ * @type {Array<WordPressV1ContentGeneratedImageResource>}
17124
17261
  * @memberof WordPressV1ContentGeneratedImagesResource
17125
17262
  */
17126
- 'images': Array<string>;
17263
+ 'images': Array<WordPressV1ContentGeneratedImageResource>;
17127
17264
  /**
17128
- * MIME type shared by all returned images
17265
+ * Time after which the image URLs stop working. Download the images before then.
17129
17266
  * @type {string}
17130
17267
  * @memberof WordPressV1ContentGeneratedImagesResource
17131
17268
  */
17132
- 'content_type': string;
17269
+ 'expires_at': string;
17270
+ }
17271
+ /**
17272
+ * State of an AI content generation and, once completed, its result.
17273
+ * @export
17274
+ * @interface WordPressV1ContentGenerationResource
17275
+ */
17276
+ export interface WordPressV1ContentGenerationResource {
17277
+ /**
17278
+ * Generation ID (UUID) used to poll for the result
17279
+ * @type {string}
17280
+ * @memberof WordPressV1ContentGenerationResource
17281
+ */
17282
+ 'generation_id': string;
17283
+ /**
17284
+ * Kind of generation, determines the shape of `result`
17285
+ * @type {string}
17286
+ * @memberof WordPressV1ContentGenerationResource
17287
+ */
17288
+ 'type': WordPressV1ContentGenerationResourceTypeEnum;
17289
+ /**
17290
+ * `in-progress` while the generation is still running, `completed` once `result` is available, `failed` when the generation stopped without a result.
17291
+ * @type {string}
17292
+ * @memberof WordPressV1ContentGenerationResource
17293
+ */
17294
+ 'status': WordPressV1ContentGenerationResourceStatusEnum;
17295
+ /**
17296
+ *
17297
+ * @type {WordPressV1ContentGenerationResourceResult}
17298
+ * @memberof WordPressV1ContentGenerationResource
17299
+ */
17300
+ 'result': WordPressV1ContentGenerationResourceResult | null;
17301
+ }
17302
+
17303
+ export const WordPressV1ContentGenerationResourceTypeEnum = {
17304
+ WebsiteGeneration: 'website-generation',
17305
+ ImageGeneration: 'image-generation'
17306
+ } as const;
17307
+
17308
+ export type WordPressV1ContentGenerationResourceTypeEnum = typeof WordPressV1ContentGenerationResourceTypeEnum[keyof typeof WordPressV1ContentGenerationResourceTypeEnum];
17309
+ export const WordPressV1ContentGenerationResourceStatusEnum = {
17310
+ InProgress: 'in-progress',
17311
+ Completed: 'completed',
17312
+ Failed: 'failed'
17313
+ } as const;
17314
+
17315
+ export type WordPressV1ContentGenerationResourceStatusEnum = typeof WordPressV1ContentGenerationResourceStatusEnum[keyof typeof WordPressV1ContentGenerationResourceStatusEnum];
17316
+
17317
+ /**
17318
+ * 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.
17319
+ * @export
17320
+ * @interface WordPressV1ContentGenerationResourceResult
17321
+ */
17322
+ export interface WordPressV1ContentGenerationResourceResult {
17323
+ /**
17324
+ * Generated images, each available at a temporary URL
17325
+ * @type {Array<WordPressV1ContentGeneratedImageResource>}
17326
+ * @memberof WordPressV1ContentGenerationResourceResult
17327
+ */
17328
+ 'images': Array<WordPressV1ContentGeneratedImageResource>;
17329
+ /**
17330
+ * Time after which the image URLs stop working. Download the images before then.
17331
+ * @type {string}
17332
+ * @memberof WordPressV1ContentGenerationResourceResult
17333
+ */
17334
+ 'expires_at': string;
17133
17335
  }
17134
17336
  /**
17135
17337
  *
@@ -28495,7 +28697,7 @@ export const EcommerceProductVariantsApiAxiosParamCreator = function (configurat
28495
28697
  };
28496
28698
  },
28497
28699
  /**
28498
- * Update up to 100 existing variants in place by id — title, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28700
+ * Update up to 100 existing variants in place by id — title, SKU, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28499
28701
  * @summary Update product variants in batch
28500
28702
  * @param {string} storeId The ID of the store that owns the product.
28501
28703
  * @param {string} productId The ID of the product whose variants are being updated.
@@ -28595,7 +28797,7 @@ export const EcommerceProductVariantsApiFp = function(configuration?: Configurat
28595
28797
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
28596
28798
  },
28597
28799
  /**
28598
- * Update up to 100 existing variants in place by id — title, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28800
+ * Update up to 100 existing variants in place by id — title, SKU, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28599
28801
  * @summary Update product variants in batch
28600
28802
  * @param {string} storeId The ID of the store that owns the product.
28601
28803
  * @param {string} productId The ID of the product whose variants are being updated.
@@ -28655,7 +28857,7 @@ export const EcommerceProductVariantsApiFactory = function (configuration?: Conf
28655
28857
  return localVarFp.listProductVariantsV1(storeId, productId, page, options).then((request) => request(axios, basePath));
28656
28858
  },
28657
28859
  /**
28658
- * Update up to 100 existing variants in place by id — title, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28860
+ * Update up to 100 existing variants in place by id — title, SKU, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28659
28861
  * @summary Update product variants in batch
28660
28862
  * @param {string} storeId The ID of the store that owns the product.
28661
28863
  * @param {string} productId The ID of the product whose variants are being updated.
@@ -28719,7 +28921,7 @@ export class EcommerceProductVariantsApi extends BaseAPI {
28719
28921
  }
28720
28922
 
28721
28923
  /**
28722
- * Update up to 100 existing variants in place by id — title, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28924
+ * Update up to 100 existing variants in place by id — title, SKU, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant\'s existing prices in full. Returns the updated variants.
28723
28925
  * @summary Update product variants in batch
28724
28926
  * @param {string} storeId The ID of the store that owns the product.
28725
28927
  * @param {string} productId The ID of the product whose variants are being updated.
@@ -28977,7 +29179,7 @@ export const EcommerceProductsApiAxiosParamCreator = function (configuration?: C
28977
29179
  };
28978
29180
  },
28979
29181
  /**
28980
- * Update a product\'s name, description or status. Set status to published to make it buyable, draft to hide it, or archived to retire it. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29182
+ * Update a product\'s name, description, status, SEO settings or collections. Set status to published to make it buyable, draft to hide it, or archived to retire it. SEO settings (title, description, slug) left out keep their values. collection_changes adds or removes collections without touching the others. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
28981
29183
  * @summary Update a product
28982
29184
  * @param {string} storeId The ID of the store that owns the product.
28983
29185
  * @param {string} productId The ID of the product to update.
@@ -29152,7 +29354,7 @@ export const EcommerceProductsApiFp = function(configuration?: Configuration) {
29152
29354
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
29153
29355
  },
29154
29356
  /**
29155
- * Update a product\'s name, description or status. Set status to published to make it buyable, draft to hide it, or archived to retire it. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29357
+ * Update a product\'s name, description, status, SEO settings or collections. Set status to published to make it buyable, draft to hide it, or archived to retire it. SEO settings (title, description, slug) left out keep their values. collection_changes adds or removes collections without touching the others. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29156
29358
  * @summary Update a product
29157
29359
  * @param {string} storeId The ID of the store that owns the product.
29158
29360
  * @param {string} productId The ID of the product to update.
@@ -29249,7 +29451,7 @@ export const EcommerceProductsApiFactory = function (configuration?: Configurati
29249
29451
  return localVarFp.listProductsV1(storeId, productIds, status, q, include, page, options).then((request) => request(axios, basePath));
29250
29452
  },
29251
29453
  /**
29252
- * Update a product\'s name, description or status. Set status to published to make it buyable, draft to hide it, or archived to retire it. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29454
+ * Update a product\'s name, description, status, SEO settings or collections. Set status to published to make it buyable, draft to hide it, or archived to retire it. SEO settings (title, description, slug) left out keep their values. collection_changes adds or removes collections without touching the others. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29253
29455
  * @summary Update a product
29254
29456
  * @param {string} storeId The ID of the store that owns the product.
29255
29457
  * @param {string} productId The ID of the product to update.
@@ -29352,7 +29554,7 @@ export class EcommerceProductsApi extends BaseAPI {
29352
29554
  }
29353
29555
 
29354
29556
  /**
29355
- * Update a product\'s name, description or status. Set status to published to make it buyable, draft to hide it, or archived to retire it. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29557
+ * Update a product\'s name, description, status, SEO settings or collections. Set status to published to make it buyable, draft to hide it, or archived to retire it. SEO settings (title, description, slug) left out keep their values. collection_changes adds or removes collections without touching the others. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
29356
29558
  * @summary Update a product
29357
29559
  * @param {string} storeId The ID of the store that owns the product.
29358
29560
  * @param {string} productId The ID of the product to update.
@@ -52068,7 +52270,7 @@ export class VPSVirtualMachineApi extends BaseAPI {
52068
52270
  export const WordPressAIContentApiAxiosParamCreator = function (configuration?: Configuration) {
52069
52271
  return {
52070
52272
  /**
52071
- * 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).
52273
+ * 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).
52072
52274
  * @summary Generate images
52073
52275
  * @param {string} username
52074
52276
  * @param {string} software WordPress installation (software) identifier
@@ -52110,6 +52312,57 @@ export const WordPressAIContentApiAxiosParamCreator = function (configuration?:
52110
52312
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
52111
52313
  localVarRequestOptions.data = serializeDataIfNeeded(wordPressV1ContentGenerateImagesRequest, localVarRequestOptions, configuration)
52112
52314
 
52315
+ return {
52316
+ url: toPathString(localVarUrlObj),
52317
+ options: localVarRequestOptions,
52318
+ };
52319
+ },
52320
+ /**
52321
+ * 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).
52322
+ * @summary Get generation result
52323
+ * @param {string} username
52324
+ * @param {string} software WordPress installation (software) identifier
52325
+ * @param {string} generationId Generation ID returned when the generation was started
52326
+ * @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
52327
+ * @param {*} [options] Override http request option.
52328
+ * @throws {RequiredError}
52329
+ */
52330
+ getGenerationResultV1: async (username: string, software: string, generationId: string, type?: GetGenerationResultV1TypeEnum, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
52331
+ // verify required parameter 'username' is not null or undefined
52332
+ assertParamExists('getGenerationResultV1', 'username', username)
52333
+ // verify required parameter 'software' is not null or undefined
52334
+ assertParamExists('getGenerationResultV1', 'software', software)
52335
+ // verify required parameter 'generationId' is not null or undefined
52336
+ assertParamExists('getGenerationResultV1', 'generationId', generationId)
52337
+ const localVarPath = `/api/hosting/v1/accounts/{username}/wordpress/{software}/content/generations/{generation_id}`
52338
+ .replace(`{${"username"}}`, encodeURIComponent(String(username)))
52339
+ .replace(`{${"software"}}`, encodeURIComponent(String(software)))
52340
+ .replace(`{${"generation_id"}}`, encodeURIComponent(String(generationId)));
52341
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
52342
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
52343
+ let baseOptions;
52344
+ if (configuration) {
52345
+ baseOptions = configuration.baseOptions;
52346
+ }
52347
+
52348
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
52349
+ const localVarHeaderParameter = {} as any;
52350
+ const localVarQueryParameter = {} as any;
52351
+
52352
+ // authentication apiToken required
52353
+ // http bearer authentication required
52354
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
52355
+
52356
+ if (type !== undefined) {
52357
+ localVarQueryParameter['type'] = type;
52358
+ }
52359
+
52360
+
52361
+
52362
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
52363
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
52364
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
52365
+
52113
52366
  return {
52114
52367
  url: toPathString(localVarUrlObj),
52115
52368
  options: localVarRequestOptions,
@@ -52126,7 +52379,7 @@ export const WordPressAIContentApiFp = function(configuration?: Configuration) {
52126
52379
  const localVarAxiosParamCreator = WordPressAIContentApiAxiosParamCreator(configuration)
52127
52380
  return {
52128
52381
  /**
52129
- * 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).
52382
+ * 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).
52130
52383
  * @summary Generate images
52131
52384
  * @param {string} username
52132
52385
  * @param {string} software WordPress installation (software) identifier
@@ -52134,11 +52387,26 @@ export const WordPressAIContentApiFp = function(configuration?: Configuration) {
52134
52387
  * @param {*} [options] Override http request option.
52135
52388
  * @throws {RequiredError}
52136
52389
  */
52137
- async generateImagesV1(username: string, software: string, wordPressV1ContentGenerateImagesRequest: WordPressV1ContentGenerateImagesRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WordPressV1ContentGeneratedImagesResource>> {
52390
+ async generateImagesV1(username: string, software: string, wordPressV1ContentGenerateImagesRequest: WordPressV1ContentGenerateImagesRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WordPressV1ContentGenerationResource>> {
52138
52391
  const localVarAxiosArgs = await localVarAxiosParamCreator.generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options);
52139
52392
  const localVarOperationServerBasePath = operationServerMap['WordPressAIContentApi.generateImagesV1']?.[0]?.url;
52140
52393
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
52141
52394
  },
52395
+ /**
52396
+ * 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).
52397
+ * @summary Get generation result
52398
+ * @param {string} username
52399
+ * @param {string} software WordPress installation (software) identifier
52400
+ * @param {string} generationId Generation ID returned when the generation was started
52401
+ * @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
52402
+ * @param {*} [options] Override http request option.
52403
+ * @throws {RequiredError}
52404
+ */
52405
+ async getGenerationResultV1(username: string, software: string, generationId: string, type?: GetGenerationResultV1TypeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WordPressV1ContentGenerationResource>> {
52406
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getGenerationResultV1(username, software, generationId, type, options);
52407
+ const localVarOperationServerBasePath = operationServerMap['WordPressAIContentApi.getGenerationResultV1']?.[0]?.url;
52408
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
52409
+ },
52142
52410
  }
52143
52411
  };
52144
52412
 
@@ -52150,7 +52418,7 @@ export const WordPressAIContentApiFactory = function (configuration?: Configurat
52150
52418
  const localVarFp = WordPressAIContentApiFp(configuration)
52151
52419
  return {
52152
52420
  /**
52153
- * 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).
52421
+ * 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).
52154
52422
  * @summary Generate images
52155
52423
  * @param {string} username
52156
52424
  * @param {string} software WordPress installation (software) identifier
@@ -52158,9 +52426,22 @@ export const WordPressAIContentApiFactory = function (configuration?: Configurat
52158
52426
  * @param {*} [options] Override http request option.
52159
52427
  * @throws {RequiredError}
52160
52428
  */
52161
- generateImagesV1(username: string, software: string, wordPressV1ContentGenerateImagesRequest: WordPressV1ContentGenerateImagesRequest, options?: RawAxiosRequestConfig): AxiosPromise<WordPressV1ContentGeneratedImagesResource> {
52429
+ generateImagesV1(username: string, software: string, wordPressV1ContentGenerateImagesRequest: WordPressV1ContentGenerateImagesRequest, options?: RawAxiosRequestConfig): AxiosPromise<WordPressV1ContentGenerationResource> {
52162
52430
  return localVarFp.generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options).then((request) => request(axios, basePath));
52163
52431
  },
52432
+ /**
52433
+ * 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).
52434
+ * @summary Get generation result
52435
+ * @param {string} username
52436
+ * @param {string} software WordPress installation (software) identifier
52437
+ * @param {string} generationId Generation ID returned when the generation was started
52438
+ * @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
52439
+ * @param {*} [options] Override http request option.
52440
+ * @throws {RequiredError}
52441
+ */
52442
+ getGenerationResultV1(username: string, software: string, generationId: string, type?: GetGenerationResultV1TypeEnum, options?: RawAxiosRequestConfig): AxiosPromise<WordPressV1ContentGenerationResource> {
52443
+ return localVarFp.getGenerationResultV1(username, software, generationId, type, options).then((request) => request(axios, basePath));
52444
+ },
52164
52445
  };
52165
52446
  };
52166
52447
 
@@ -52172,7 +52453,7 @@ export const WordPressAIContentApiFactory = function (configuration?: Configurat
52172
52453
  */
52173
52454
  export class WordPressAIContentApi extends BaseAPI {
52174
52455
  /**
52175
- * 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).
52456
+ * 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).
52176
52457
  * @summary Generate images
52177
52458
  * @param {string} username
52178
52459
  * @param {string} software WordPress installation (software) identifier
@@ -52184,8 +52465,31 @@ export class WordPressAIContentApi extends BaseAPI {
52184
52465
  public generateImagesV1(username: string, software: string, wordPressV1ContentGenerateImagesRequest: WordPressV1ContentGenerateImagesRequest, options?: RawAxiosRequestConfig) {
52185
52466
  return WordPressAIContentApiFp(this.configuration).generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options).then((request) => request(this.axios, this.basePath));
52186
52467
  }
52468
+
52469
+ /**
52470
+ * 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).
52471
+ * @summary Get generation result
52472
+ * @param {string} username
52473
+ * @param {string} software WordPress installation (software) identifier
52474
+ * @param {string} generationId Generation ID returned when the generation was started
52475
+ * @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
52476
+ * @param {*} [options] Override http request option.
52477
+ * @throws {RequiredError}
52478
+ * @memberof WordPressAIContentApi
52479
+ */
52480
+ public getGenerationResultV1(username: string, software: string, generationId: string, type?: GetGenerationResultV1TypeEnum, options?: RawAxiosRequestConfig) {
52481
+ return WordPressAIContentApiFp(this.configuration).getGenerationResultV1(username, software, generationId, type, options).then((request) => request(this.axios, this.basePath));
52482
+ }
52187
52483
  }
52188
52484
 
52485
+ /**
52486
+ * @export
52487
+ */
52488
+ export const GetGenerationResultV1TypeEnum = {
52489
+ WebsiteGeneration: 'website-generation',
52490
+ ImageGeneration: 'image-generation'
52491
+ } as const;
52492
+ export type GetGenerationResultV1TypeEnum = typeof GetGenerationResultV1TypeEnum[keyof typeof GetGenerationResultV1TypeEnum];
52189
52493
 
52190
52494
 
52191
52495
  /**
package/base.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.68.0
6
+ * API Version: 2.1.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/common.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.68.0
6
+ * API Version: 2.1.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/configuration.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.68.0
6
+ * API Version: 2.1.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
@@ -48,7 +48,7 @@ export class Configuration {
48
48
  this.baseOptions = {
49
49
  ...param.baseOptions,
50
50
  headers: {
51
- 'User-Agent': "hostinger-typescript-sdk/1.68.0",
51
+ 'User-Agent': "hostinger-typescript-sdk/2.1.0",
52
52
  ...param.baseOptions?.headers,
53
53
  },
54
54
  };