hostinger-mail-api-sdk 1.0.2
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/.github/workflows/build-release.yaml +91 -0
- package/CODEOWNERS +1 -0
- package/README.md +9 -0
- package/api.ts +3760 -0
- package/base.ts +83 -0
- package/common.ts +111 -0
- package/configuration.ts +72 -0
- package/dist/api.d.ts +2426 -0
- package/dist/api.js +2484 -0
- package/dist/base.d.ts +63 -0
- package/dist/base.js +62 -0
- package/dist/common.d.ts +47 -0
- package/dist/common.js +118 -0
- package/dist/configuration.d.ts +51 -0
- package/dist/configuration.js +37 -0
- package/dist/esm/api.d.ts +2426 -0
- package/dist/esm/api.js +2457 -0
- package/dist/esm/base.d.ts +63 -0
- package/dist/esm/base.js +57 -0
- package/dist/esm/common.d.ts +47 -0
- package/dist/esm/common.js +109 -0
- package/dist/esm/configuration.d.ts +51 -0
- package/dist/esm/configuration.js +33 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.js +12 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +28 -0
- package/docs/AccountApi.md +55 -0
- package/docs/Error.md +25 -0
- package/docs/FoldersApi.md +259 -0
- package/docs/MessagesApi.md +860 -0
- package/docs/Pagination.md +27 -0
- package/docs/QuotaApi.md +63 -0
- package/docs/SendApi.md +68 -0
- package/docs/V1FolderMessagesCollection.md +23 -0
- package/docs/V1FolderMessagesDeleteBulkRequest.md +21 -0
- package/docs/V1FolderMessagesFlagsBulkRequest.md +25 -0
- package/docs/V1FolderMessagesFlagsRequest.md +23 -0
- package/docs/V1FolderMessagesMessage.md +47 -0
- package/docs/V1FolderMessagesMessageAddress.md +23 -0
- package/docs/V1FolderMessagesMessageAttachment.md +31 -0
- package/docs/V1FolderMessagesMessageText.md +23 -0
- package/docs/V1FolderMessagesMessageTextResource.md +21 -0
- package/docs/V1FolderMessagesMoveBulkRequest.md +23 -0
- package/docs/V1FolderMessagesMoveRequest.md +21 -0
- package/docs/V1FolderMessagesResource.md +21 -0
- package/docs/V1FolderMessagesSearchRequest.md +45 -0
- package/docs/V1FolderMessagesUpdateFlagsResult.md +21 -0
- package/docs/V1FolderMessagesUpdateFlagsResultData.md +22 -0
- package/docs/V1FolderMessagesUpdateFlagsResultDataFailedInner.md +22 -0
- package/docs/V1FoldersCollection.md +23 -0
- package/docs/V1FoldersCreateRequest.md +21 -0
- package/docs/V1FoldersFolder.md +31 -0
- package/docs/V1FoldersResource.md +21 -0
- package/docs/V1FoldersUpdateRequest.md +21 -0
- package/docs/V1MeMailbox.md +23 -0
- package/docs/V1MeResource.md +21 -0
- package/docs/V1MeResourceData.md +22 -0
- package/docs/V1QuotaQuota.md +29 -0
- package/docs/V1QuotaQuotaResource.md +27 -0
- package/docs/V1QuotaResource.md +21 -0
- package/docs/V1SendAttachment.md +29 -0
- package/docs/V1SendRequest.md +35 -0
- package/docs/V1WebhooksCollection.md +23 -0
- package/docs/V1WebhooksCreateRequest.md +29 -0
- package/docs/V1WebhooksResource.md +21 -0
- package/docs/V1WebhooksResourceWithSecret.md +21 -0
- package/docs/V1WebhooksTestResult.md +21 -0
- package/docs/V1WebhooksTestResultData.md +24 -0
- package/docs/V1WebhooksUpdateRequest.md +29 -0
- package/docs/V1WebhooksWebhook.md +39 -0
- package/docs/V1WebhooksWebhookWithSecret.md +41 -0
- package/docs/WebhooksApi.md +439 -0
- package/index.ts +15 -0
- package/package.json +34 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hostinger Email API
|
|
3
|
+
*
|
|
4
|
+
* API Version: 1.0.0
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
8
|
+
*/
|
|
9
|
+
import type { Configuration } from './configuration';
|
|
10
|
+
import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
11
|
+
export declare const BASE_PATH: string;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const COLLECTION_FORMATS: {
|
|
17
|
+
csv: string;
|
|
18
|
+
ssv: string;
|
|
19
|
+
tsv: string;
|
|
20
|
+
pipes: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
* @interface RequestArgs
|
|
26
|
+
*/
|
|
27
|
+
export interface RequestArgs {
|
|
28
|
+
url: string;
|
|
29
|
+
options: RawAxiosRequestConfig;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @class BaseAPI
|
|
35
|
+
*/
|
|
36
|
+
export declare class BaseAPI {
|
|
37
|
+
protected basePath: string;
|
|
38
|
+
protected axios: AxiosInstance;
|
|
39
|
+
protected configuration: Configuration | undefined;
|
|
40
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @export
|
|
45
|
+
* @class RequiredError
|
|
46
|
+
* @extends {Error}
|
|
47
|
+
*/
|
|
48
|
+
export declare class RequiredError extends Error {
|
|
49
|
+
field: string;
|
|
50
|
+
constructor(field: string, msg?: string);
|
|
51
|
+
}
|
|
52
|
+
interface ServerMap {
|
|
53
|
+
[key: string]: {
|
|
54
|
+
url: string;
|
|
55
|
+
description: string;
|
|
56
|
+
}[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @export
|
|
61
|
+
*/
|
|
62
|
+
export declare const operationServerMap: ServerMap;
|
|
63
|
+
export {};
|
package/dist/esm/base.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Hostinger Email API
|
|
5
|
+
*
|
|
6
|
+
* API Version: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
*/
|
|
11
|
+
import globalAxios from 'axios';
|
|
12
|
+
export const BASE_PATH = "https://api.mail.hostinger.com".replace(/\/+$/, "");
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
*/
|
|
17
|
+
export const COLLECTION_FORMATS = {
|
|
18
|
+
csv: ",",
|
|
19
|
+
ssv: " ",
|
|
20
|
+
tsv: "\t",
|
|
21
|
+
pipes: "|",
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @class BaseAPI
|
|
27
|
+
*/
|
|
28
|
+
export class BaseAPI {
|
|
29
|
+
constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
|
|
30
|
+
var _a;
|
|
31
|
+
this.basePath = basePath;
|
|
32
|
+
this.axios = axios;
|
|
33
|
+
if (configuration) {
|
|
34
|
+
this.configuration = configuration;
|
|
35
|
+
this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @export
|
|
43
|
+
* @class RequiredError
|
|
44
|
+
* @extends {Error}
|
|
45
|
+
*/
|
|
46
|
+
export class RequiredError extends Error {
|
|
47
|
+
constructor(field, msg) {
|
|
48
|
+
super(msg);
|
|
49
|
+
this.field = field;
|
|
50
|
+
this.name = "RequiredError";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @export
|
|
56
|
+
*/
|
|
57
|
+
export const operationServerMap = {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hostinger Email API
|
|
3
|
+
*
|
|
4
|
+
* API Version: 1.0.0
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
8
|
+
*/
|
|
9
|
+
import type { Configuration } from "./configuration";
|
|
10
|
+
import type { RequestArgs } from "./base";
|
|
11
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @throws {RequiredError}
|
|
20
|
+
* @export
|
|
21
|
+
*/
|
|
22
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
*/
|
|
27
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @export
|
|
31
|
+
*/
|
|
32
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @export
|
|
36
|
+
*/
|
|
37
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @export
|
|
41
|
+
*/
|
|
42
|
+
export declare const toPathString: (url: URL) => string;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Hostinger Email API
|
|
5
|
+
*
|
|
6
|
+
* API Version: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
*/
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
import { RequiredError } from "./base";
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export const DUMMY_BASE_URL = 'https://example.com';
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @throws {RequiredError}
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
export const assertParamExists = function (functionName, paramName, paramValue) {
|
|
32
|
+
if (paramValue === null || paramValue === undefined) {
|
|
33
|
+
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export const setBearerAuthToObject = function (object, configuration) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (configuration && configuration.accessToken) {
|
|
43
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
44
|
+
? yield configuration.accessToken()
|
|
45
|
+
: yield configuration.accessToken;
|
|
46
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
51
|
+
if (parameter == null)
|
|
52
|
+
return;
|
|
53
|
+
if (typeof parameter === "object") {
|
|
54
|
+
if (Array.isArray(parameter)) {
|
|
55
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
if (urlSearchParams.has(key)) {
|
|
63
|
+
urlSearchParams.append(key, parameter);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
urlSearchParams.set(key, parameter);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @export
|
|
73
|
+
*/
|
|
74
|
+
export const setSearchParams = function (url, ...objects) {
|
|
75
|
+
const searchParams = new URLSearchParams(url.search);
|
|
76
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
77
|
+
url.search = searchParams.toString();
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @export
|
|
82
|
+
*/
|
|
83
|
+
export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
84
|
+
const nonString = typeof value !== 'string';
|
|
85
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
86
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
87
|
+
: nonString;
|
|
88
|
+
return needsSerialization
|
|
89
|
+
? JSON.stringify(value !== undefined ? value : {})
|
|
90
|
+
: (value || "");
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @export
|
|
95
|
+
*/
|
|
96
|
+
export const toPathString = function (url) {
|
|
97
|
+
return url.pathname + url.search + url.hash;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @export
|
|
102
|
+
*/
|
|
103
|
+
export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
104
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
105
|
+
var _a;
|
|
106
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
|
|
107
|
+
return axios.request(axiosRequestArgs);
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hostinger Email API
|
|
3
|
+
*
|
|
4
|
+
* API Version: 1.0.0
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfigurationParameters {
|
|
10
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
11
|
+
basePath?: string;
|
|
12
|
+
baseOptions?: any;
|
|
13
|
+
formDataCtor?: new () => any;
|
|
14
|
+
}
|
|
15
|
+
export declare class Configuration {
|
|
16
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
17
|
+
/**
|
|
18
|
+
* override base path
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof Configuration
|
|
22
|
+
*/
|
|
23
|
+
basePath?: string;
|
|
24
|
+
/**
|
|
25
|
+
* override server index
|
|
26
|
+
*
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof Configuration
|
|
29
|
+
*/
|
|
30
|
+
baseOptions?: any;
|
|
31
|
+
/**
|
|
32
|
+
* The FormData constructor that will be used to create multipart form data
|
|
33
|
+
* requests. You can inject this here so that execution environments that
|
|
34
|
+
* do not support the FormData class can still run the generated client.
|
|
35
|
+
*
|
|
36
|
+
* @type {new () => FormData}
|
|
37
|
+
*/
|
|
38
|
+
formDataCtor?: new () => any;
|
|
39
|
+
constructor(param?: ConfigurationParameters);
|
|
40
|
+
/**
|
|
41
|
+
* Check if the given MIME is a JSON MIME.
|
|
42
|
+
* JSON MIME examples:
|
|
43
|
+
* application/json
|
|
44
|
+
* application/json; charset=UTF8
|
|
45
|
+
* APPLICATION/JSON
|
|
46
|
+
* application/vnd.company+json
|
|
47
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
48
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
49
|
+
*/
|
|
50
|
+
isJsonMime(mime: string): boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Hostinger Email API
|
|
5
|
+
*
|
|
6
|
+
* API Version: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
*/
|
|
11
|
+
export class Configuration {
|
|
12
|
+
constructor(param = {}) {
|
|
13
|
+
var _a;
|
|
14
|
+
this.accessToken = param.accessToken;
|
|
15
|
+
this.basePath = param.basePath;
|
|
16
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-mail-typescript-sdk/1.0.2" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
|
|
17
|
+
this.formDataCtor = param.formDataCtor;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Check if the given MIME is a JSON MIME.
|
|
21
|
+
* JSON MIME examples:
|
|
22
|
+
* application/json
|
|
23
|
+
* application/json; charset=UTF8
|
|
24
|
+
* APPLICATION/JSON
|
|
25
|
+
* application/vnd.company+json
|
|
26
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
27
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
28
|
+
*/
|
|
29
|
+
isJsonMime(mime) {
|
|
30
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
31
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hostinger Email API
|
|
3
|
+
*
|
|
4
|
+
* API Version: 1.0.0
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
8
|
+
*/
|
|
9
|
+
export * from "./api";
|
|
10
|
+
export * from "./configuration";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Hostinger Email API
|
|
5
|
+
*
|
|
6
|
+
* API Version: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
*/
|
|
11
|
+
export * from "./api";
|
|
12
|
+
export * from "./configuration";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hostinger Email API
|
|
3
|
+
*
|
|
4
|
+
* API Version: 1.0.0
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
8
|
+
*/
|
|
9
|
+
export * from "./api";
|
|
10
|
+
export * from "./configuration";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Hostinger Email API
|
|
6
|
+
*
|
|
7
|
+
* API Version: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
|
+
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
11
|
+
*/
|
|
12
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
24
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
__exportStar(require("./api"), exports);
|
|
28
|
+
__exportStar(require("./configuration"), exports);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# AccountApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.mail.hostinger.com*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**getCurrentAccount**](#getcurrentaccount) | **GET** /api/v1/me | Get the authenticated account|
|
|
8
|
+
|
|
9
|
+
# **getCurrentAccount**
|
|
10
|
+
> V1MeResource getCurrentAccount()
|
|
11
|
+
|
|
12
|
+
Returns the authenticated account and the mailboxes it can manage.
|
|
13
|
+
|
|
14
|
+
### Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import {
|
|
18
|
+
AccountApi,
|
|
19
|
+
Configuration
|
|
20
|
+
} from 'hostinger-mail-api-sdk';
|
|
21
|
+
|
|
22
|
+
const configuration = new Configuration();
|
|
23
|
+
const apiInstance = new AccountApi(configuration);
|
|
24
|
+
|
|
25
|
+
const { status, data } = await apiInstance.getCurrentAccount();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Parameters
|
|
29
|
+
This endpoint does not have any parameters.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Return type
|
|
33
|
+
|
|
34
|
+
**V1MeResource**
|
|
35
|
+
|
|
36
|
+
### Authorization
|
|
37
|
+
|
|
38
|
+
[BearerAuth](../README.md#BearerAuth)
|
|
39
|
+
|
|
40
|
+
### HTTP request headers
|
|
41
|
+
|
|
42
|
+
- **Content-Type**: Not defined
|
|
43
|
+
- **Accept**: application/json
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### HTTP response details
|
|
47
|
+
| Status code | Description | Response headers |
|
|
48
|
+
|-------------|-------------|------------------|
|
|
49
|
+
|**200** | Authenticated account with the mailboxes the API key can manage. | - |
|
|
50
|
+
|**401** | Missing or invalid credentials. | - |
|
|
51
|
+
|**500** | Server-side failure. | - |
|
|
52
|
+
|**502** | Upstream service is unavailable or returned an unexpected response. | - |
|
|
53
|
+
|
|
54
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
55
|
+
|
package/docs/Error.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ModelError
|
|
2
|
+
|
|
3
|
+
Standard error envelope. Frontend translations key off `code`, never off `error`.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**error** | **string** | Human-readable error message. | [default to undefined]
|
|
10
|
+
**code** | **string** | Machine-readable error code in SCREAMING_SNAKE_CASE. | [default to undefined]
|
|
11
|
+
**params** | **{ [key: string]: any; }** | Additional structured context for the error. May be omitted. | [optional] [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { ModelError } from 'hostinger-mail-api-sdk';
|
|
17
|
+
|
|
18
|
+
const instance: ModelError = {
|
|
19
|
+
error,
|
|
20
|
+
code,
|
|
21
|
+
params,
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|