Skip to content

Commit 565df4f

Browse files
committed
feature: typescript sdk release
1 parent 2dc2471 commit 565df4f

7 files changed

Lines changed: 96 additions & 241 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## hostinger-api@0.0.7
1+
## hostinger-api@0.0.2
22

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

api.ts

Lines changed: 89 additions & 157 deletions
Large diffs are not rendered by default.

base.ts

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

common.ts

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Hostinger API
55
*
6-
* API Version: 0.0.6
6+
* API Version: 0.0.7
77
*
88
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
99
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
@@ -32,29 +32,6 @@ export const assertParamExists = function (functionName: string, paramName: stri
3232
}
3333
}
3434

35-
/**
36-
*
37-
* @export
38-
*/
39-
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
40-
if (configuration && configuration.apiKey) {
41-
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
42-
? await configuration.apiKey(keyParamName)
43-
: await configuration.apiKey;
44-
object[keyParamName] = localVarApiKeyValue;
45-
}
46-
}
47-
48-
/**
49-
*
50-
* @export
51-
*/
52-
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
53-
if (configuration && (configuration.username || configuration.password)) {
54-
object["auth"] = { username: configuration.username, password: configuration.password };
55-
}
56-
}
57-
5835
/**
5936
*
6037
* @export
@@ -68,19 +45,6 @@ export const setBearerAuthToObject = async function (object: any, configuration?
6845
}
6946
}
7047

71-
/**
72-
*
73-
* @export
74-
*/
75-
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
76-
if (configuration && configuration.accessToken) {
77-
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
78-
? await configuration.accessToken(name, scopes)
79-
: await configuration.accessToken;
80-
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
81-
}
82-
}
83-
8448
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
8549
if (parameter == null) return;
8650
if (typeof parameter === "object") {

configuration.ts

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,21 @@
33
/**
44
* Hostinger API
55
*
6-
* API Version: 0.0.6
6+
* API Version: 0.0.7
77
*
88
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
99
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
1010
*/
1111

1212

1313
export interface ConfigurationParameters {
14-
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
15-
username?: string;
16-
password?: string;
1714
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
1815
basePath?: string;
19-
serverIndex?: number;
2016
baseOptions?: any;
2117
formDataCtor?: new () => any;
2218
}
2319

2420
export class Configuration {
25-
/**
26-
* parameter for apiKey security
27-
* @param name security name
28-
* @memberof Configuration
29-
*/
30-
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
31-
/**
32-
* parameter for basic security
33-
*
34-
* @type {string}
35-
* @memberof Configuration
36-
*/
37-
username?: string;
38-
/**
39-
* parameter for basic security
40-
*
41-
* @type {string}
42-
* @memberof Configuration
43-
*/
44-
password?: string;
45-
/**
46-
* parameter for oauth2 security
47-
* @param name security name
48-
* @param scopes oauth2 scope
49-
* @memberof Configuration
50-
*/
5121
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
5222
/**
5323
* override base path
@@ -62,13 +32,6 @@ export class Configuration {
6232
* @type {number}
6333
* @memberof Configuration
6434
*/
65-
serverIndex?: number;
66-
/**
67-
* base options for axios calls
68-
*
69-
* @type {any}
70-
* @memberof Configuration
71-
*/
7235
baseOptions?: any;
7336
/**
7437
* The FormData constructor that will be used to create multipart form data
@@ -80,16 +43,12 @@ export class Configuration {
8043
formDataCtor?: new () => any;
8144

8245
constructor(param: ConfigurationParameters = {}) {
83-
this.apiKey = param.apiKey;
84-
this.username = param.username;
85-
this.password = param.password;
8646
this.accessToken = param.accessToken;
8747
this.basePath = param.basePath;
88-
this.serverIndex = param.serverIndex;
8948
this.baseOptions = {
9049
...param.baseOptions,
9150
headers: {
92-
'User-Agent': "hostinger-api-typescript/0.0.7",
51+
'User-Agent': "hostinger-api-typescript/0.0.2",
9352
...param.baseOptions?.headers,
9453
},
9554
};

index.ts

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hostinger-api",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Hostinger API TypeScript SDK",
55
"author": "Hostinger",
66
"repository": {

0 commit comments

Comments
 (0)