@hostinger/mail-sdk 1.19.6 → 1.19.8

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.js CHANGED
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Hostinger Mail API
6
6
  *
7
- * API Version: 1.2.2
7
+ * API Version: 1.3.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
@@ -19,7 +19,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
19
  });
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setBearerAuthToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
22
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setBearerAuthToObject = exports.encodePathParam = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
23
23
  const base_1 = require("./base");
24
24
  /**
25
25
  *
@@ -37,6 +37,19 @@ const assertParamExists = function (functionName, paramName, paramValue) {
37
37
  }
38
38
  };
39
39
  exports.assertParamExists = assertParamExists;
40
+ /**
41
+ * Empty values and dot segments survive encoding and collapse or resolve away, which would change the endpoint.
42
+ * @throws {RequiredError}
43
+ * @export
44
+ */
45
+ const encodePathParam = function (paramName, paramValue) {
46
+ const value = String(paramValue);
47
+ if (value === '' || value === '.' || value === '..') {
48
+ throw new base_1.RequiredError(paramName, `Invalid value for path parameter ${paramName}.`);
49
+ }
50
+ return encodeURIComponent(value);
51
+ };
52
+ exports.encodePathParam = encodePathParam;
40
53
  /**
41
54
  *
42
55
  * @export
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hostinger Mail API
3
3
  *
4
- * API Version: 1.2.2
4
+ * API Version: 1.3.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 Mail API
6
6
  *
7
- * API Version: 1.2.2
7
+ * API Version: 1.3.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-mail-typescript-sdk/1.19.6" }, (_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-mail-typescript-sdk/1.19.8" }, (_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 Mail API
3
3
  *
4
- * API Version: 1.2.2
4
+ * API Version: 1.3.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
@@ -873,13 +873,13 @@ export interface V1SendRequest {
873
873
  */
874
874
  'attachments': Array<V1SendAttachment>;
875
875
  /**
876
- * Source message this is a reply to. Copies its Message-Id/References into In-Reply-To/References and flags it \\Answered. Mutually exclusive with forwardOf.
876
+ * Source message this is a reply to, as an object {uid, folder} — not the Message-ID header string. Copies its Message-Id/References into In-Reply-To/References and flags it \\Answered. Mutually exclusive with forwardOf.
877
877
  * @type {V1SendMessageRef}
878
878
  * @memberof V1SendRequest
879
879
  */
880
880
  'inReplyTo': V1SendMessageRef;
881
881
  /**
882
- * Source message this forwards. Copies its Message-Id/References into In-Reply-To/References and flags it $forwarded. Mutually exclusive with inReplyTo.
882
+ * Source message this forwards, as an object {uid, folder} — not the Message-ID header string. Copies its Message-Id/References into In-Reply-To/References and flags it $forwarded. Mutually exclusive with inReplyTo.
883
883
  * @type {V1SendMessageRef}
884
884
  * @memberof V1SendRequest
885
885
  */
@@ -1578,7 +1578,7 @@ export declare const MessagesApiAxiosParamCreator: (configuration?: Configuratio
1578
1578
  */
1579
1579
  getMessageAttachment: (mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1580
1580
  /**
1581
- * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
1581
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment. Does not change the message `\\Seen` flag.
1582
1582
  * @summary Get message source
1583
1583
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1584
1584
  * @param {string} folder Folder path (URL-encoded).
@@ -1588,7 +1588,7 @@ export declare const MessagesApiAxiosParamCreator: (configuration?: Configuratio
1588
1588
  */
1589
1589
  getMessageSource: (mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1590
1590
  /**
1591
- * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
1591
+ * Retrieve rendered text (plain + HTML) of a message. Does not change the message `\\Seen` flag.
1592
1592
  * @summary Get message text content
1593
1593
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1594
1594
  * @param {string} folder Folder path (URL-encoded).
@@ -1721,7 +1721,7 @@ export declare const MessagesApiFp: (configuration?: Configuration) => {
1721
1721
  */
1722
1722
  getMessageAttachment(mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>>;
1723
1723
  /**
1724
- * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
1724
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment. Does not change the message `\\Seen` flag.
1725
1725
  * @summary Get message source
1726
1726
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1727
1727
  * @param {string} folder Folder path (URL-encoded).
@@ -1731,7 +1731,7 @@ export declare const MessagesApiFp: (configuration?: Configuration) => {
1731
1731
  */
1732
1732
  getMessageSource(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>>;
1733
1733
  /**
1734
- * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
1734
+ * Retrieve rendered text (plain + HTML) of a message. Does not change the message `\\Seen` flag.
1735
1735
  * @summary Get message text content
1736
1736
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1737
1737
  * @param {string} folder Folder path (URL-encoded).
@@ -1864,7 +1864,7 @@ export declare const MessagesApiFactory: (configuration?: Configuration, basePat
1864
1864
  */
1865
1865
  getMessageAttachment(mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig): AxiosPromise<File>;
1866
1866
  /**
1867
- * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
1867
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment. Does not change the message `\\Seen` flag.
1868
1868
  * @summary Get message source
1869
1869
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1870
1870
  * @param {string} folder Folder path (URL-encoded).
@@ -1874,7 +1874,7 @@ export declare const MessagesApiFactory: (configuration?: Configuration, basePat
1874
1874
  */
1875
1875
  getMessageSource(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): AxiosPromise<File>;
1876
1876
  /**
1877
- * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
1877
+ * Retrieve rendered text (plain + HTML) of a message. Does not change the message `\\Seen` flag.
1878
1878
  * @summary Get message text content
1879
1879
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
1880
1880
  * @param {string} folder Folder path (URL-encoded).
@@ -2014,7 +2014,7 @@ export declare class MessagesApi extends BaseAPI {
2014
2014
  */
2015
2015
  getMessageAttachment(mailboxResourceId: string, folder: string, uid: number, attachmentId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<File, any, {}, any>>;
2016
2016
  /**
2017
- * Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
2017
+ * Retrieve raw RFC822 source of a message as `message/rfc822` attachment. Does not change the message `\\Seen` flag.
2018
2018
  * @summary Get message source
2019
2019
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2020
2020
  * @param {string} folder Folder path (URL-encoded).
@@ -2025,7 +2025,7 @@ export declare class MessagesApi extends BaseAPI {
2025
2025
  */
2026
2026
  getMessageSource(mailboxResourceId: string, folder: string, uid: number, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<File, any, {}, any>>;
2027
2027
  /**
2028
- * Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
2028
+ * Retrieve rendered text (plain + HTML) of a message. Does not change the message `\\Seen` flag.
2029
2029
  * @summary Get message text content
2030
2030
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2031
2031
  * @param {string} folder Folder path (URL-encoded).
@@ -2177,11 +2177,11 @@ export declare const SendApiAxiosParamCreator: (configuration?: Configuration) =
2177
2177
  * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
2178
2178
  * @summary Send email
2179
2179
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2180
- * @param {V1SendRequest | null} v1SendRequest
2180
+ * @param {V1SendRequest} v1SendRequest
2181
2181
  * @param {*} [options] Override http request option.
2182
2182
  * @throws {RequiredError}
2183
2183
  */
2184
- sendEmail: (mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2184
+ sendEmail: (mailboxResourceId: string, v1SendRequest: V1SendRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2185
2185
  };
2186
2186
  /**
2187
2187
  * SendApi - functional programming interface
@@ -2192,11 +2192,11 @@ export declare const SendApiFp: (configuration?: Configuration) => {
2192
2192
  * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
2193
2193
  * @summary Send email
2194
2194
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2195
- * @param {V1SendRequest | null} v1SendRequest
2195
+ * @param {V1SendRequest} v1SendRequest
2196
2196
  * @param {*} [options] Override http request option.
2197
2197
  * @throws {RequiredError}
2198
2198
  */
2199
- sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
2199
+ sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
2200
2200
  };
2201
2201
  /**
2202
2202
  * SendApi - factory interface
@@ -2207,11 +2207,11 @@ export declare const SendApiFactory: (configuration?: Configuration, basePath?:
2207
2207
  * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
2208
2208
  * @summary Send email
2209
2209
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2210
- * @param {V1SendRequest | null} v1SendRequest
2210
+ * @param {V1SendRequest} v1SendRequest
2211
2211
  * @param {*} [options] Override http request option.
2212
2212
  * @throws {RequiredError}
2213
2213
  */
2214
- sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig): AxiosPromise<void>;
2214
+ sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;
2215
2215
  };
2216
2216
  /**
2217
2217
  * SendApi - object-oriented interface
@@ -2224,12 +2224,12 @@ export declare class SendApi extends BaseAPI {
2224
2224
  * Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
2225
2225
  * @summary Send email
2226
2226
  * @param {string} mailboxResourceId Resource ID of the managed mailbox the bearer token is authorized for.
2227
- * @param {V1SendRequest | null} v1SendRequest
2227
+ * @param {V1SendRequest} v1SendRequest
2228
2228
  * @param {*} [options] Override http request option.
2229
2229
  * @throws {RequiredError}
2230
2230
  * @memberof SendApi
2231
2231
  */
2232
- sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest | null, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
2232
+ sendEmail(mailboxResourceId: string, v1SendRequest: V1SendRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
2233
2233
  }
2234
2234
  /**
2235
2235
  * WebhooksApi - axios parameter creator