hostinger-api-sdk 0.0.23 → 0.0.25

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/dist/common.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hostinger API
3
3
  *
4
- * API Version: 0.20.0
4
+ * API Version: 0.22.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/common.js CHANGED
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Hostinger API
6
6
  *
7
- * API Version: 0.20.0
7
+ * API Version: 0.22.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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hostinger API
3
3
  *
4
- * API Version: 0.20.0
4
+ * API Version: 0.22.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
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Hostinger API
6
6
  *
7
- * API Version: 0.20.0
7
+ * API Version: 0.22.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
@@ -16,7 +16,7 @@ class Configuration {
16
16
  var _a;
17
17
  this.accessToken = param.accessToken;
18
18
  this.basePath = param.basePath;
19
- this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/0.0.23" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
19
+ this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/0.0.25" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
20
20
  this.formDataCtor = param.formDataCtor;
21
21
  }
22
22
  /**
package/dist/esm/api.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hostinger API
3
3
  *
4
- * API Version: 0.20.0
4
+ * API Version: 0.22.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
@@ -2086,6 +2086,69 @@ export interface HostingListWebsitesV1200Response {
2086
2086
  */
2087
2087
  'meta': CommonSchemaPaginationMetaSchema;
2088
2088
  }
2089
+ /**
2090
+ *
2091
+ * @export
2092
+ * @interface HostingV1CronJobsCreateCronJobRequest
2093
+ */
2094
+ export interface HostingV1CronJobsCreateCronJobRequest {
2095
+ /**
2096
+ * Cron schedule expression (for example \"0 2 * * *\" runs daily at 02:00).
2097
+ * @type {string}
2098
+ * @memberof HostingV1CronJobsCreateCronJobRequest
2099
+ */
2100
+ 'time': string;
2101
+ /**
2102
+ * Command to execute on the schedule.
2103
+ * @type {string}
2104
+ * @memberof HostingV1CronJobsCreateCronJobRequest
2105
+ */
2106
+ 'command': string;
2107
+ }
2108
+ /**
2109
+ *
2110
+ * @export
2111
+ * @interface HostingV1CronJobsCronJobOutputResource
2112
+ */
2113
+ export interface HostingV1CronJobsCronJobOutputResource {
2114
+ /**
2115
+ * Output captured from the last cron job execution. Empty when the cron job has not run yet.
2116
+ * @type {string}
2117
+ * @memberof HostingV1CronJobsCronJobOutputResource
2118
+ */
2119
+ 'output': string;
2120
+ }
2121
+ /**
2122
+ *
2123
+ * @export
2124
+ * @interface HostingV1CronJobsCronJobResource
2125
+ */
2126
+ export interface HostingV1CronJobsCronJobResource {
2127
+ /**
2128
+ * Unique identifier of the cron job. Use it to delete the cron job or fetch its output.
2129
+ * @type {string}
2130
+ * @memberof HostingV1CronJobsCronJobResource
2131
+ */
2132
+ 'uid': string;
2133
+ /**
2134
+ * Username of the account that owns the cron job.
2135
+ * @type {string}
2136
+ * @memberof HostingV1CronJobsCronJobResource
2137
+ */
2138
+ 'username': string;
2139
+ /**
2140
+ * Cron schedule expression.
2141
+ * @type {string}
2142
+ * @memberof HostingV1CronJobsCronJobResource
2143
+ */
2144
+ 'time': string;
2145
+ /**
2146
+ * Command executed on the schedule.
2147
+ * @type {string}
2148
+ * @memberof HostingV1CronJobsCronJobResource
2149
+ */
2150
+ 'command': string;
2151
+ }
2089
2152
  /**
2090
2153
  *
2091
2154
  * @export
@@ -6961,6 +7024,176 @@ export declare class HorizonsWebsitesApi extends BaseAPI {
6961
7024
  */
6962
7025
  getWebsiteV1(websiteId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<HorizonsV1WebsitesWebsiteUrlResource, any, {}>>;
6963
7026
  }
7027
+ /**
7028
+ * HostingCronJobsApi - axios parameter creator
7029
+ * @export
7030
+ */
7031
+ export declare const HostingCronJobsApiAxiosParamCreator: (configuration?: Configuration) => {
7032
+ /**
7033
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
7034
+ * @summary Create account cron job
7035
+ * @param {string} username
7036
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
7037
+ * @param {*} [options] Override http request option.
7038
+ * @throws {RequiredError}
7039
+ */
7040
+ createAccountCronJobV1: (username: string, hostingV1CronJobsCreateCronJobRequest: HostingV1CronJobsCreateCronJobRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
7041
+ /**
7042
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7043
+ * @summary Delete account cron job
7044
+ * @param {string} username
7045
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7046
+ * @param {*} [options] Override http request option.
7047
+ * @throws {RequiredError}
7048
+ */
7049
+ deleteAccountCronJobV1: (username: string, uid: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
7050
+ /**
7051
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7052
+ * @summary Get cron job output
7053
+ * @param {string} username
7054
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7055
+ * @param {*} [options] Override http request option.
7056
+ * @throws {RequiredError}
7057
+ */
7058
+ getCronJobOutputV1: (username: string, uid: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
7059
+ /**
7060
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
7061
+ * @summary List account cron jobs
7062
+ * @param {string} username
7063
+ * @param {*} [options] Override http request option.
7064
+ * @throws {RequiredError}
7065
+ */
7066
+ listAccountCronJobsV1: (username: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
7067
+ };
7068
+ /**
7069
+ * HostingCronJobsApi - functional programming interface
7070
+ * @export
7071
+ */
7072
+ export declare const HostingCronJobsApiFp: (configuration?: Configuration) => {
7073
+ /**
7074
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
7075
+ * @summary Create account cron job
7076
+ * @param {string} username
7077
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
7078
+ * @param {*} [options] Override http request option.
7079
+ * @throws {RequiredError}
7080
+ */
7081
+ createAccountCronJobV1(username: string, hostingV1CronJobsCreateCronJobRequest: HostingV1CronJobsCreateCronJobRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<HostingV1CronJobsCronJobResource>>;
7082
+ /**
7083
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7084
+ * @summary Delete account cron job
7085
+ * @param {string} username
7086
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7087
+ * @param {*} [options] Override http request option.
7088
+ * @throws {RequiredError}
7089
+ */
7090
+ deleteAccountCronJobV1(username: string, uid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>>;
7091
+ /**
7092
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7093
+ * @summary Get cron job output
7094
+ * @param {string} username
7095
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7096
+ * @param {*} [options] Override http request option.
7097
+ * @throws {RequiredError}
7098
+ */
7099
+ getCronJobOutputV1(username: string, uid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<HostingV1CronJobsCronJobOutputResource>>;
7100
+ /**
7101
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
7102
+ * @summary List account cron jobs
7103
+ * @param {string} username
7104
+ * @param {*} [options] Override http request option.
7105
+ * @throws {RequiredError}
7106
+ */
7107
+ listAccountCronJobsV1(username: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<HostingV1CronJobsCronJobResource>>>;
7108
+ };
7109
+ /**
7110
+ * HostingCronJobsApi - factory interface
7111
+ * @export
7112
+ */
7113
+ export declare const HostingCronJobsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
7114
+ /**
7115
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
7116
+ * @summary Create account cron job
7117
+ * @param {string} username
7118
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
7119
+ * @param {*} [options] Override http request option.
7120
+ * @throws {RequiredError}
7121
+ */
7122
+ createAccountCronJobV1(username: string, hostingV1CronJobsCreateCronJobRequest: HostingV1CronJobsCreateCronJobRequest, options?: RawAxiosRequestConfig): AxiosPromise<HostingV1CronJobsCronJobResource>;
7123
+ /**
7124
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7125
+ * @summary Delete account cron job
7126
+ * @param {string} username
7127
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7128
+ * @param {*} [options] Override http request option.
7129
+ * @throws {RequiredError}
7130
+ */
7131
+ deleteAccountCronJobV1(username: string, uid: string, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource>;
7132
+ /**
7133
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7134
+ * @summary Get cron job output
7135
+ * @param {string} username
7136
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7137
+ * @param {*} [options] Override http request option.
7138
+ * @throws {RequiredError}
7139
+ */
7140
+ getCronJobOutputV1(username: string, uid: string, options?: RawAxiosRequestConfig): AxiosPromise<HostingV1CronJobsCronJobOutputResource>;
7141
+ /**
7142
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
7143
+ * @summary List account cron jobs
7144
+ * @param {string} username
7145
+ * @param {*} [options] Override http request option.
7146
+ * @throws {RequiredError}
7147
+ */
7148
+ listAccountCronJobsV1(username: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<HostingV1CronJobsCronJobResource>>;
7149
+ };
7150
+ /**
7151
+ * HostingCronJobsApi - object-oriented interface
7152
+ * @export
7153
+ * @class HostingCronJobsApi
7154
+ * @extends {BaseAPI}
7155
+ */
7156
+ export declare class HostingCronJobsApi extends BaseAPI {
7157
+ /**
7158
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
7159
+ * @summary Create account cron job
7160
+ * @param {string} username
7161
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
7162
+ * @param {*} [options] Override http request option.
7163
+ * @throws {RequiredError}
7164
+ * @memberof HostingCronJobsApi
7165
+ */
7166
+ createAccountCronJobV1(username: string, hostingV1CronJobsCreateCronJobRequest: HostingV1CronJobsCreateCronJobRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<HostingV1CronJobsCronJobResource, any, {}>>;
7167
+ /**
7168
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7169
+ * @summary Delete account cron job
7170
+ * @param {string} username
7171
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7172
+ * @param {*} [options] Override http request option.
7173
+ * @throws {RequiredError}
7174
+ * @memberof HostingCronJobsApi
7175
+ */
7176
+ deleteAccountCronJobV1(username: string, uid: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<CommonSuccessEmptyResource, any, {}>>;
7177
+ /**
7178
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
7179
+ * @summary Get cron job output
7180
+ * @param {string} username
7181
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
7182
+ * @param {*} [options] Override http request option.
7183
+ * @throws {RequiredError}
7184
+ * @memberof HostingCronJobsApi
7185
+ */
7186
+ getCronJobOutputV1(username: string, uid: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<HostingV1CronJobsCronJobOutputResource, any, {}>>;
7187
+ /**
7188
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
7189
+ * @summary List account cron jobs
7190
+ * @param {string} username
7191
+ * @param {*} [options] Override http request option.
7192
+ * @throws {RequiredError}
7193
+ * @memberof HostingCronJobsApi
7194
+ */
7195
+ listAccountCronJobsV1(username: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<HostingV1CronJobsCronJobResource[], any, {}>>;
7196
+ }
6964
7197
  /**
6965
7198
  * HostingDatabasesApi - axios parameter creator
6966
7199
  * @export
package/dist/esm/api.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 0.20.0
6
+ * API Version: 0.22.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
@@ -3832,6 +3832,334 @@ export class HorizonsWebsitesApi extends BaseAPI {
3832
3832
  return HorizonsWebsitesApiFp(this.configuration).getWebsiteV1(websiteId, options).then((request) => request(this.axios, this.basePath));
3833
3833
  }
3834
3834
  }
3835
+ /**
3836
+ * HostingCronJobsApi - axios parameter creator
3837
+ * @export
3838
+ */
3839
+ export const HostingCronJobsApiAxiosParamCreator = function (configuration) {
3840
+ return {
3841
+ /**
3842
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
3843
+ * @summary Create account cron job
3844
+ * @param {string} username
3845
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
3846
+ * @param {*} [options] Override http request option.
3847
+ * @throws {RequiredError}
3848
+ */
3849
+ createAccountCronJobV1: (username_1, hostingV1CronJobsCreateCronJobRequest_1, ...args_1) => __awaiter(this, [username_1, hostingV1CronJobsCreateCronJobRequest_1, ...args_1], void 0, function* (username, hostingV1CronJobsCreateCronJobRequest, options = {}) {
3850
+ // verify required parameter 'username' is not null or undefined
3851
+ assertParamExists('createAccountCronJobV1', 'username', username);
3852
+ // verify required parameter 'hostingV1CronJobsCreateCronJobRequest' is not null or undefined
3853
+ assertParamExists('createAccountCronJobV1', 'hostingV1CronJobsCreateCronJobRequest', hostingV1CronJobsCreateCronJobRequest);
3854
+ const localVarPath = `/api/hosting/v1/accounts/{username}/cron-jobs`
3855
+ .replace(`{${"username"}}`, encodeURIComponent(String(username)));
3856
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3857
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3858
+ let baseOptions;
3859
+ if (configuration) {
3860
+ baseOptions = configuration.baseOptions;
3861
+ }
3862
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
3863
+ const localVarHeaderParameter = {};
3864
+ const localVarQueryParameter = {};
3865
+ // authentication apiToken required
3866
+ // http bearer authentication required
3867
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
3868
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3869
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3870
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3871
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3872
+ localVarRequestOptions.data = serializeDataIfNeeded(hostingV1CronJobsCreateCronJobRequest, localVarRequestOptions, configuration);
3873
+ return {
3874
+ url: toPathString(localVarUrlObj),
3875
+ options: localVarRequestOptions,
3876
+ };
3877
+ }),
3878
+ /**
3879
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
3880
+ * @summary Delete account cron job
3881
+ * @param {string} username
3882
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
3883
+ * @param {*} [options] Override http request option.
3884
+ * @throws {RequiredError}
3885
+ */
3886
+ deleteAccountCronJobV1: (username_1, uid_1, ...args_1) => __awaiter(this, [username_1, uid_1, ...args_1], void 0, function* (username, uid, options = {}) {
3887
+ // verify required parameter 'username' is not null or undefined
3888
+ assertParamExists('deleteAccountCronJobV1', 'username', username);
3889
+ // verify required parameter 'uid' is not null or undefined
3890
+ assertParamExists('deleteAccountCronJobV1', 'uid', uid);
3891
+ const localVarPath = `/api/hosting/v1/accounts/{username}/cron-jobs/{uid}`
3892
+ .replace(`{${"username"}}`, encodeURIComponent(String(username)))
3893
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
3894
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3895
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3896
+ let baseOptions;
3897
+ if (configuration) {
3898
+ baseOptions = configuration.baseOptions;
3899
+ }
3900
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
3901
+ const localVarHeaderParameter = {};
3902
+ const localVarQueryParameter = {};
3903
+ // authentication apiToken required
3904
+ // http bearer authentication required
3905
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
3906
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3907
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3908
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3909
+ return {
3910
+ url: toPathString(localVarUrlObj),
3911
+ options: localVarRequestOptions,
3912
+ };
3913
+ }),
3914
+ /**
3915
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
3916
+ * @summary Get cron job output
3917
+ * @param {string} username
3918
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
3919
+ * @param {*} [options] Override http request option.
3920
+ * @throws {RequiredError}
3921
+ */
3922
+ getCronJobOutputV1: (username_1, uid_1, ...args_1) => __awaiter(this, [username_1, uid_1, ...args_1], void 0, function* (username, uid, options = {}) {
3923
+ // verify required parameter 'username' is not null or undefined
3924
+ assertParamExists('getCronJobOutputV1', 'username', username);
3925
+ // verify required parameter 'uid' is not null or undefined
3926
+ assertParamExists('getCronJobOutputV1', 'uid', uid);
3927
+ const localVarPath = `/api/hosting/v1/accounts/{username}/cron-jobs/{uid}/output`
3928
+ .replace(`{${"username"}}`, encodeURIComponent(String(username)))
3929
+ .replace(`{${"uid"}}`, encodeURIComponent(String(uid)));
3930
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3931
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3932
+ let baseOptions;
3933
+ if (configuration) {
3934
+ baseOptions = configuration.baseOptions;
3935
+ }
3936
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
3937
+ const localVarHeaderParameter = {};
3938
+ const localVarQueryParameter = {};
3939
+ // authentication apiToken required
3940
+ // http bearer authentication required
3941
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
3942
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3943
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3944
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3945
+ return {
3946
+ url: toPathString(localVarUrlObj),
3947
+ options: localVarRequestOptions,
3948
+ };
3949
+ }),
3950
+ /**
3951
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
3952
+ * @summary List account cron jobs
3953
+ * @param {string} username
3954
+ * @param {*} [options] Override http request option.
3955
+ * @throws {RequiredError}
3956
+ */
3957
+ listAccountCronJobsV1: (username_1, ...args_1) => __awaiter(this, [username_1, ...args_1], void 0, function* (username, options = {}) {
3958
+ // verify required parameter 'username' is not null or undefined
3959
+ assertParamExists('listAccountCronJobsV1', 'username', username);
3960
+ const localVarPath = `/api/hosting/v1/accounts/{username}/cron-jobs`
3961
+ .replace(`{${"username"}}`, encodeURIComponent(String(username)));
3962
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3963
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3964
+ let baseOptions;
3965
+ if (configuration) {
3966
+ baseOptions = configuration.baseOptions;
3967
+ }
3968
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
3969
+ const localVarHeaderParameter = {};
3970
+ const localVarQueryParameter = {};
3971
+ // authentication apiToken required
3972
+ // http bearer authentication required
3973
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
3974
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3975
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3976
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3977
+ return {
3978
+ url: toPathString(localVarUrlObj),
3979
+ options: localVarRequestOptions,
3980
+ };
3981
+ }),
3982
+ };
3983
+ };
3984
+ /**
3985
+ * HostingCronJobsApi - functional programming interface
3986
+ * @export
3987
+ */
3988
+ export const HostingCronJobsApiFp = function (configuration) {
3989
+ const localVarAxiosParamCreator = HostingCronJobsApiAxiosParamCreator(configuration);
3990
+ return {
3991
+ /**
3992
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
3993
+ * @summary Create account cron job
3994
+ * @param {string} username
3995
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
3996
+ * @param {*} [options] Override http request option.
3997
+ * @throws {RequiredError}
3998
+ */
3999
+ createAccountCronJobV1(username, hostingV1CronJobsCreateCronJobRequest, options) {
4000
+ return __awaiter(this, void 0, void 0, function* () {
4001
+ var _a, _b;
4002
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createAccountCronJobV1(username, hostingV1CronJobsCreateCronJobRequest, options);
4003
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['HostingCronJobsApi.createAccountCronJobV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
4004
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4005
+ });
4006
+ },
4007
+ /**
4008
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
4009
+ * @summary Delete account cron job
4010
+ * @param {string} username
4011
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
4012
+ * @param {*} [options] Override http request option.
4013
+ * @throws {RequiredError}
4014
+ */
4015
+ deleteAccountCronJobV1(username, uid, options) {
4016
+ return __awaiter(this, void 0, void 0, function* () {
4017
+ var _a, _b;
4018
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAccountCronJobV1(username, uid, options);
4019
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['HostingCronJobsApi.deleteAccountCronJobV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
4020
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4021
+ });
4022
+ },
4023
+ /**
4024
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
4025
+ * @summary Get cron job output
4026
+ * @param {string} username
4027
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
4028
+ * @param {*} [options] Override http request option.
4029
+ * @throws {RequiredError}
4030
+ */
4031
+ getCronJobOutputV1(username, uid, options) {
4032
+ return __awaiter(this, void 0, void 0, function* () {
4033
+ var _a, _b;
4034
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getCronJobOutputV1(username, uid, options);
4035
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['HostingCronJobsApi.getCronJobOutputV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
4036
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4037
+ });
4038
+ },
4039
+ /**
4040
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
4041
+ * @summary List account cron jobs
4042
+ * @param {string} username
4043
+ * @param {*} [options] Override http request option.
4044
+ * @throws {RequiredError}
4045
+ */
4046
+ listAccountCronJobsV1(username, options) {
4047
+ return __awaiter(this, void 0, void 0, function* () {
4048
+ var _a, _b;
4049
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listAccountCronJobsV1(username, options);
4050
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['HostingCronJobsApi.listAccountCronJobsV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
4051
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4052
+ });
4053
+ },
4054
+ };
4055
+ };
4056
+ /**
4057
+ * HostingCronJobsApi - factory interface
4058
+ * @export
4059
+ */
4060
+ export const HostingCronJobsApiFactory = function (configuration, basePath, axios) {
4061
+ const localVarFp = HostingCronJobsApiFp(configuration);
4062
+ return {
4063
+ /**
4064
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
4065
+ * @summary Create account cron job
4066
+ * @param {string} username
4067
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
4068
+ * @param {*} [options] Override http request option.
4069
+ * @throws {RequiredError}
4070
+ */
4071
+ createAccountCronJobV1(username, hostingV1CronJobsCreateCronJobRequest, options) {
4072
+ return localVarFp.createAccountCronJobV1(username, hostingV1CronJobsCreateCronJobRequest, options).then((request) => request(axios, basePath));
4073
+ },
4074
+ /**
4075
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
4076
+ * @summary Delete account cron job
4077
+ * @param {string} username
4078
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
4079
+ * @param {*} [options] Override http request option.
4080
+ * @throws {RequiredError}
4081
+ */
4082
+ deleteAccountCronJobV1(username, uid, options) {
4083
+ return localVarFp.deleteAccountCronJobV1(username, uid, options).then((request) => request(axios, basePath));
4084
+ },
4085
+ /**
4086
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
4087
+ * @summary Get cron job output
4088
+ * @param {string} username
4089
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
4090
+ * @param {*} [options] Override http request option.
4091
+ * @throws {RequiredError}
4092
+ */
4093
+ getCronJobOutputV1(username, uid, options) {
4094
+ return localVarFp.getCronJobOutputV1(username, uid, options).then((request) => request(axios, basePath));
4095
+ },
4096
+ /**
4097
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
4098
+ * @summary List account cron jobs
4099
+ * @param {string} username
4100
+ * @param {*} [options] Override http request option.
4101
+ * @throws {RequiredError}
4102
+ */
4103
+ listAccountCronJobsV1(username, options) {
4104
+ return localVarFp.listAccountCronJobsV1(username, options).then((request) => request(axios, basePath));
4105
+ },
4106
+ };
4107
+ };
4108
+ /**
4109
+ * HostingCronJobsApi - object-oriented interface
4110
+ * @export
4111
+ * @class HostingCronJobsApi
4112
+ * @extends {BaseAPI}
4113
+ */
4114
+ export class HostingCronJobsApi extends BaseAPI {
4115
+ /**
4116
+ * Creates a cron job for the specified account from a schedule expression and a command. Returns the created cron job, including its uid, which is required to delete the cron job or fetch its output.
4117
+ * @summary Create account cron job
4118
+ * @param {string} username
4119
+ * @param {HostingV1CronJobsCreateCronJobRequest} hostingV1CronJobsCreateCronJobRequest
4120
+ * @param {*} [options] Override http request option.
4121
+ * @throws {RequiredError}
4122
+ * @memberof HostingCronJobsApi
4123
+ */
4124
+ createAccountCronJobV1(username, hostingV1CronJobsCreateCronJobRequest, options) {
4125
+ return HostingCronJobsApiFp(this.configuration).createAccountCronJobV1(username, hostingV1CronJobsCreateCronJobRequest, options).then((request) => request(this.axios, this.basePath));
4126
+ }
4127
+ /**
4128
+ * Permanently deletes the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
4129
+ * @summary Delete account cron job
4130
+ * @param {string} username
4131
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
4132
+ * @param {*} [options] Override http request option.
4133
+ * @throws {RequiredError}
4134
+ * @memberof HostingCronJobsApi
4135
+ */
4136
+ deleteAccountCronJobV1(username, uid, options) {
4137
+ return HostingCronJobsApiFp(this.configuration).deleteAccountCronJobV1(username, uid, options).then((request) => request(this.axios, this.basePath));
4138
+ }
4139
+ /**
4140
+ * Returns the output captured from the last execution of the cron job identified by its uid. The uid is returned by the list cron jobs endpoint.
4141
+ * @summary Get cron job output
4142
+ * @param {string} username
4143
+ * @param {string} uid Unique identifier of the cron job as returned by the list cron jobs endpoint.
4144
+ * @param {*} [options] Override http request option.
4145
+ * @throws {RequiredError}
4146
+ * @memberof HostingCronJobsApi
4147
+ */
4148
+ getCronJobOutputV1(username, uid, options) {
4149
+ return HostingCronJobsApiFp(this.configuration).getCronJobOutputV1(username, uid, options).then((request) => request(this.axios, this.basePath));
4150
+ }
4151
+ /**
4152
+ * Returns the list of cron jobs configured for the specified account, including their schedule and command.
4153
+ * @summary List account cron jobs
4154
+ * @param {string} username
4155
+ * @param {*} [options] Override http request option.
4156
+ * @throws {RequiredError}
4157
+ * @memberof HostingCronJobsApi
4158
+ */
4159
+ listAccountCronJobsV1(username, options) {
4160
+ return HostingCronJobsApiFp(this.configuration).listAccountCronJobsV1(username, options).then((request) => request(this.axios, this.basePath));
4161
+ }
4162
+ }
3835
4163
  /**
3836
4164
  * HostingDatabasesApi - axios parameter creator
3837
4165
  * @export
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hostinger API
3
3
  *
4
- * API Version: 0.20.0
4
+ * API Version: 0.22.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: 0.20.0
6
+ * API Version: 0.22.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