hostinger-api-sdk 1.21.1 → 1.22.1

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 CHANGED
@@ -1,9 +1,9 @@
1
- ## hostinger-api-sdk@1.21.1
1
+ ## hostinger-api-sdk@1.22.1
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-api-sdk@1.21.1 --save
8
+ npm install hostinger-api-sdk@1.22.1 --save
9
9
  ```
package/api.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.22.0
6
+ * API Version: 1.23.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
@@ -1791,6 +1791,25 @@ export const BillingV1SubscriptionCancelRequestCancelOptionEnum = {
1791
1791
 
1792
1792
  export type BillingV1SubscriptionCancelRequestCancelOptionEnum = typeof BillingV1SubscriptionCancelRequestCancelOptionEnum[keyof typeof BillingV1SubscriptionCancelRequestCancelOptionEnum];
1793
1793
 
1794
+ /**
1795
+ *
1796
+ * @export
1797
+ * @interface BillingV1SubscriptionRenewalRenewRequest
1798
+ */
1799
+ export interface BillingV1SubscriptionRenewalRenewRequest {
1800
+ /**
1801
+ * Payment method ID, default will be used if not provided
1802
+ * @type {number}
1803
+ * @memberof BillingV1SubscriptionRenewalRenewRequest
1804
+ */
1805
+ 'payment_method_id': number;
1806
+ /**
1807
+ * Discount coupon codes
1808
+ * @type {Array<any>}
1809
+ * @memberof BillingV1SubscriptionRenewalRenewRequest
1810
+ */
1811
+ 'coupons': Array<any>;
1812
+ }
1794
1813
  /**
1795
1814
  *
1796
1815
  * @export
@@ -13519,6 +13538,48 @@ export const BillingSubscriptionsApiAxiosParamCreator = function (configuration?
13519
13538
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
13520
13539
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
13521
13540
 
13541
+ return {
13542
+ url: toPathString(localVarUrlObj),
13543
+ options: localVarRequestOptions,
13544
+ };
13545
+ },
13546
+ /**
13547
+ * Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
13548
+ * @summary Renew subscription
13549
+ * @param {string} subscriptionId Subscription ID
13550
+ * @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
13551
+ * @param {*} [options] Override http request option.
13552
+ * @throws {RequiredError}
13553
+ */
13554
+ renewSubscriptionV1: async (subscriptionId: string, billingV1SubscriptionRenewalRenewRequest?: BillingV1SubscriptionRenewalRenewRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
13555
+ // verify required parameter 'subscriptionId' is not null or undefined
13556
+ assertParamExists('renewSubscriptionV1', 'subscriptionId', subscriptionId)
13557
+ const localVarPath = `/api/billing/v1/subscriptions/{subscriptionId}/renew`
13558
+ .replace(`{${"subscriptionId"}}`, encodeURIComponent(String(subscriptionId)));
13559
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
13560
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
13561
+ let baseOptions;
13562
+ if (configuration) {
13563
+ baseOptions = configuration.baseOptions;
13564
+ }
13565
+
13566
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
13567
+ const localVarHeaderParameter = {} as any;
13568
+ const localVarQueryParameter = {} as any;
13569
+
13570
+ // authentication apiToken required
13571
+ // http bearer authentication required
13572
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
13573
+
13574
+
13575
+
13576
+ localVarHeaderParameter['Content-Type'] = 'application/json';
13577
+
13578
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
13579
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
13580
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
13581
+ localVarRequestOptions.data = serializeDataIfNeeded(billingV1SubscriptionRenewalRenewRequest, localVarRequestOptions, configuration)
13582
+
13522
13583
  return {
13523
13584
  url: toPathString(localVarUrlObj),
13524
13585
  options: localVarRequestOptions,
@@ -13569,6 +13630,19 @@ export const BillingSubscriptionsApiFp = function(configuration?: Configuration)
13569
13630
  const localVarOperationServerBasePath = operationServerMap['BillingSubscriptionsApi.getSubscriptionListV1']?.[0]?.url;
13570
13631
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
13571
13632
  },
13633
+ /**
13634
+ * Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
13635
+ * @summary Renew subscription
13636
+ * @param {string} subscriptionId Subscription ID
13637
+ * @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
13638
+ * @param {*} [options] Override http request option.
13639
+ * @throws {RequiredError}
13640
+ */
13641
+ async renewSubscriptionV1(subscriptionId: string, billingV1SubscriptionRenewalRenewRequest?: BillingV1SubscriptionRenewalRenewRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BillingV1OrderOrderResource>> {
13642
+ const localVarAxiosArgs = await localVarAxiosParamCreator.renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options);
13643
+ const localVarOperationServerBasePath = operationServerMap['BillingSubscriptionsApi.renewSubscriptionV1']?.[0]?.url;
13644
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
13645
+ },
13572
13646
  }
13573
13647
  };
13574
13648
 
@@ -13608,6 +13682,17 @@ export const BillingSubscriptionsApiFactory = function (configuration?: Configur
13608
13682
  getSubscriptionListV1(options?: RawAxiosRequestConfig): AxiosPromise<Array<BillingV1SubscriptionSubscriptionResource>> {
13609
13683
  return localVarFp.getSubscriptionListV1(options).then((request) => request(axios, basePath));
13610
13684
  },
13685
+ /**
13686
+ * Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
13687
+ * @summary Renew subscription
13688
+ * @param {string} subscriptionId Subscription ID
13689
+ * @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
13690
+ * @param {*} [options] Override http request option.
13691
+ * @throws {RequiredError}
13692
+ */
13693
+ renewSubscriptionV1(subscriptionId: string, billingV1SubscriptionRenewalRenewRequest?: BillingV1SubscriptionRenewalRenewRequest, options?: RawAxiosRequestConfig): AxiosPromise<BillingV1OrderOrderResource> {
13694
+ return localVarFp.renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options).then((request) => request(axios, basePath));
13695
+ },
13611
13696
  };
13612
13697
  };
13613
13698
 
@@ -13652,6 +13737,19 @@ export class BillingSubscriptionsApi extends BaseAPI {
13652
13737
  public getSubscriptionListV1(options?: RawAxiosRequestConfig) {
13653
13738
  return BillingSubscriptionsApiFp(this.configuration).getSubscriptionListV1(options).then((request) => request(this.axios, this.basePath));
13654
13739
  }
13740
+
13741
+ /**
13742
+ * Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
13743
+ * @summary Renew subscription
13744
+ * @param {string} subscriptionId Subscription ID
13745
+ * @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
13746
+ * @param {*} [options] Override http request option.
13747
+ * @throws {RequiredError}
13748
+ * @memberof BillingSubscriptionsApi
13749
+ */
13750
+ public renewSubscriptionV1(subscriptionId: string, billingV1SubscriptionRenewalRenewRequest?: BillingV1SubscriptionRenewalRenewRequest, options?: RawAxiosRequestConfig) {
13751
+ return BillingSubscriptionsApiFp(this.configuration).renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options).then((request) => request(this.axios, this.basePath));
13752
+ }
13655
13753
  }
13656
13754
 
13657
13755
 
package/base.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.22.0
6
+ * API Version: 1.23.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.22.0
6
+ * API Version: 1.23.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
@@ -106,6 +106,6 @@ export const toPathString = function (url: URL) {
106
106
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
107
107
  return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
108
108
  const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
109
- return axios.request<T, R>(axiosRequestArgs);
109
+ return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
110
110
  };
111
111
  }
package/configuration.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.22.0
6
+ * API Version: 1.23.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.21.1",
51
+ 'User-Agent': "hostinger-typescript-sdk/1.22.1",
52
52
  ...param.baseOptions?.headers,
53
53
  },
54
54
  };