@hostinger/mail-sdk 1.19.0

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.
Files changed (78) hide show
  1. package/.github/workflows/build-release.yaml +135 -0
  2. package/CODEOWNERS +1 -0
  3. package/README.md +9 -0
  4. package/api.ts +3791 -0
  5. package/base.ts +83 -0
  6. package/common.ts +111 -0
  7. package/configuration.ts +72 -0
  8. package/dist/api.d.ts +2457 -0
  9. package/dist/api.js +2484 -0
  10. package/dist/base.d.ts +63 -0
  11. package/dist/base.js +62 -0
  12. package/dist/common.d.ts +47 -0
  13. package/dist/common.js +118 -0
  14. package/dist/configuration.d.ts +51 -0
  15. package/dist/configuration.js +37 -0
  16. package/dist/esm/api.d.ts +2457 -0
  17. package/dist/esm/api.js +2457 -0
  18. package/dist/esm/base.d.ts +63 -0
  19. package/dist/esm/base.js +57 -0
  20. package/dist/esm/common.d.ts +47 -0
  21. package/dist/esm/common.js +109 -0
  22. package/dist/esm/configuration.d.ts +51 -0
  23. package/dist/esm/configuration.js +33 -0
  24. package/dist/esm/index.d.ts +10 -0
  25. package/dist/esm/index.js +12 -0
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.js +28 -0
  28. package/docs/AccountApi.md +55 -0
  29. package/docs/Error.md +25 -0
  30. package/docs/FoldersApi.md +259 -0
  31. package/docs/MessagesApi.md +860 -0
  32. package/docs/Pagination.md +27 -0
  33. package/docs/QuotaApi.md +63 -0
  34. package/docs/SendApi.md +68 -0
  35. package/docs/V1FolderMessagesCollection.md +23 -0
  36. package/docs/V1FolderMessagesDeleteBulkRequest.md +21 -0
  37. package/docs/V1FolderMessagesFlagsBulkRequest.md +25 -0
  38. package/docs/V1FolderMessagesFlagsRequest.md +23 -0
  39. package/docs/V1FolderMessagesMessage.md +47 -0
  40. package/docs/V1FolderMessagesMessageAddress.md +23 -0
  41. package/docs/V1FolderMessagesMessageAttachment.md +31 -0
  42. package/docs/V1FolderMessagesMessageText.md +23 -0
  43. package/docs/V1FolderMessagesMessageTextResource.md +21 -0
  44. package/docs/V1FolderMessagesMoveBulkRequest.md +23 -0
  45. package/docs/V1FolderMessagesMoveRequest.md +21 -0
  46. package/docs/V1FolderMessagesResource.md +21 -0
  47. package/docs/V1FolderMessagesSearchRequest.md +45 -0
  48. package/docs/V1FolderMessagesUpdateFlagsResult.md +21 -0
  49. package/docs/V1FolderMessagesUpdateFlagsResultData.md +22 -0
  50. package/docs/V1FolderMessagesUpdateFlagsResultDataFailedInner.md +22 -0
  51. package/docs/V1FoldersCollection.md +23 -0
  52. package/docs/V1FoldersCreateRequest.md +21 -0
  53. package/docs/V1FoldersFolder.md +31 -0
  54. package/docs/V1FoldersResource.md +21 -0
  55. package/docs/V1FoldersUpdateRequest.md +21 -0
  56. package/docs/V1MeMailbox.md +23 -0
  57. package/docs/V1MeResource.md +21 -0
  58. package/docs/V1MeResourceData.md +22 -0
  59. package/docs/V1QuotaQuota.md +29 -0
  60. package/docs/V1QuotaQuotaResource.md +27 -0
  61. package/docs/V1QuotaResource.md +21 -0
  62. package/docs/V1SendAttachment.md +29 -0
  63. package/docs/V1SendMessageRef.md +23 -0
  64. package/docs/V1SendRequest.md +39 -0
  65. package/docs/V1WebhooksCollection.md +23 -0
  66. package/docs/V1WebhooksCreateRequest.md +29 -0
  67. package/docs/V1WebhooksResource.md +21 -0
  68. package/docs/V1WebhooksResourceWithSecret.md +21 -0
  69. package/docs/V1WebhooksTestResult.md +21 -0
  70. package/docs/V1WebhooksTestResultData.md +24 -0
  71. package/docs/V1WebhooksUpdateRequest.md +29 -0
  72. package/docs/V1WebhooksWebhook.md +39 -0
  73. package/docs/V1WebhooksWebhookWithSecret.md +41 -0
  74. package/docs/WebhooksApi.md +439 -0
  75. package/index.ts +15 -0
  76. package/package.json +34 -0
  77. package/tsconfig.esm.json +7 -0
  78. package/tsconfig.json +18 -0
@@ -0,0 +1,259 @@
1
+ # FoldersApi
2
+
3
+ All URIs are relative to *https://api.mail.hostinger.com*
4
+
5
+ |Method | HTTP request | Description|
6
+ |------------- | ------------- | -------------|
7
+ |[**createFolder**](#createfolder) | **POST** /api/v1/mailboxes/{mailboxResourceId}/folders | Create folder|
8
+ |[**deleteFolder**](#deletefolder) | **DELETE** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} | Delete folder|
9
+ |[**listFolders**](#listfolders) | **GET** /api/v1/mailboxes/{mailboxResourceId}/folders | List folders|
10
+ |[**updateFolder**](#updatefolder) | **PUT** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} | Update folder|
11
+
12
+ # **createFolder**
13
+ > V1FoldersResource createFolder(v1FoldersCreateRequest)
14
+
15
+ Create a new folder in the managed mailbox.
16
+
17
+ ### Example
18
+
19
+ ```typescript
20
+ import {
21
+ FoldersApi,
22
+ Configuration,
23
+ V1FoldersCreateRequest
24
+ } from '@hostinger/mail-sdk';
25
+
26
+ const configuration = new Configuration();
27
+ const apiInstance = new FoldersApi(configuration);
28
+
29
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
30
+ let v1FoldersCreateRequest: V1FoldersCreateRequest; //
31
+
32
+ const { status, data } = await apiInstance.createFolder(
33
+ mailboxResourceId,
34
+ v1FoldersCreateRequest
35
+ );
36
+ ```
37
+
38
+ ### Parameters
39
+
40
+ |Name | Type | Description | Notes|
41
+ |------------- | ------------- | ------------- | -------------|
42
+ | **v1FoldersCreateRequest** | **V1FoldersCreateRequest**| | |
43
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
44
+
45
+
46
+ ### Return type
47
+
48
+ **V1FoldersResource**
49
+
50
+ ### Authorization
51
+
52
+ [BearerAuth](../README.md#BearerAuth)
53
+
54
+ ### HTTP request headers
55
+
56
+ - **Content-Type**: application/json
57
+ - **Accept**: application/json
58
+
59
+
60
+ ### HTTP response details
61
+ | Status code | Description | Response headers |
62
+ |-------------|-------------|------------------|
63
+ |**201** | Folder created. | - |
64
+ |**401** | Missing or invalid credentials. | - |
65
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
66
+ |**409** | Conflict with the target resource. | - |
67
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
68
+ |**500** | Server-side failure. | - |
69
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
70
+
71
+ [[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)
72
+
73
+ # **deleteFolder**
74
+ > deleteFolder()
75
+
76
+ Delete a folder and all of its subfolders.
77
+
78
+ ### Example
79
+
80
+ ```typescript
81
+ import {
82
+ FoldersApi,
83
+ Configuration
84
+ } from '@hostinger/mail-sdk';
85
+
86
+ const configuration = new Configuration();
87
+ const apiInstance = new FoldersApi(configuration);
88
+
89
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
90
+ let folder: string; //Folder path to delete (URL-encoded). (default to undefined)
91
+
92
+ const { status, data } = await apiInstance.deleteFolder(
93
+ mailboxResourceId,
94
+ folder
95
+ );
96
+ ```
97
+
98
+ ### Parameters
99
+
100
+ |Name | Type | Description | Notes|
101
+ |------------- | ------------- | ------------- | -------------|
102
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
103
+ | **folder** | [**string**] | Folder path to delete (URL-encoded). | defaults to undefined|
104
+
105
+
106
+ ### Return type
107
+
108
+ void (empty response body)
109
+
110
+ ### Authorization
111
+
112
+ [BearerAuth](../README.md#BearerAuth)
113
+
114
+ ### HTTP request headers
115
+
116
+ - **Content-Type**: Not defined
117
+ - **Accept**: application/json
118
+
119
+
120
+ ### HTTP response details
121
+ | Status code | Description | Response headers |
122
+ |-------------|-------------|------------------|
123
+ |**204** | Folder and all subfolders deleted. | - |
124
+ |**401** | Missing or invalid credentials. | - |
125
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
126
+ |**404** | Resource not found. | - |
127
+ |**409** | Conflict with the target resource. | - |
128
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
129
+ |**500** | Server-side failure. | - |
130
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
131
+
132
+ [[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)
133
+
134
+ # **listFolders**
135
+ > V1FoldersCollection listFolders()
136
+
137
+ Retrieve a paginated list of folders in the managed mailbox.
138
+
139
+ ### Example
140
+
141
+ ```typescript
142
+ import {
143
+ FoldersApi,
144
+ Configuration
145
+ } from '@hostinger/mail-sdk';
146
+
147
+ const configuration = new Configuration();
148
+ const apiInstance = new FoldersApi(configuration);
149
+
150
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
151
+ let page: number; //Page number (1-based). (optional) (default to 1)
152
+ let perPage: number; //Items per page (max 100). (optional) (default to 25)
153
+
154
+ const { status, data } = await apiInstance.listFolders(
155
+ mailboxResourceId,
156
+ page,
157
+ perPage
158
+ );
159
+ ```
160
+
161
+ ### Parameters
162
+
163
+ |Name | Type | Description | Notes|
164
+ |------------- | ------------- | ------------- | -------------|
165
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
166
+ | **page** | [**number**] | Page number (1-based). | (optional) defaults to 1|
167
+ | **perPage** | [**number**] | Items per page (max 100). | (optional) defaults to 25|
168
+
169
+
170
+ ### Return type
171
+
172
+ **V1FoldersCollection**
173
+
174
+ ### Authorization
175
+
176
+ [BearerAuth](../README.md#BearerAuth)
177
+
178
+ ### HTTP request headers
179
+
180
+ - **Content-Type**: Not defined
181
+ - **Accept**: application/json
182
+
183
+
184
+ ### HTTP response details
185
+ | Status code | Description | Response headers |
186
+ |-------------|-------------|------------------|
187
+ |**200** | Paginated list of folders. | - |
188
+ |**401** | Missing or invalid credentials. | - |
189
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
190
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
191
+ |**500** | Server-side failure. | - |
192
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
193
+
194
+ [[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)
195
+
196
+ # **updateFolder**
197
+ > V1FoldersResource updateFolder(v1FoldersUpdateRequest)
198
+
199
+ Rename an existing folder.
200
+
201
+ ### Example
202
+
203
+ ```typescript
204
+ import {
205
+ FoldersApi,
206
+ Configuration,
207
+ V1FoldersUpdateRequest
208
+ } from '@hostinger/mail-sdk';
209
+
210
+ const configuration = new Configuration();
211
+ const apiInstance = new FoldersApi(configuration);
212
+
213
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
214
+ let folder: string; //Current folder path (URL-encoded). (default to undefined)
215
+ let v1FoldersUpdateRequest: V1FoldersUpdateRequest; //
216
+
217
+ const { status, data } = await apiInstance.updateFolder(
218
+ mailboxResourceId,
219
+ folder,
220
+ v1FoldersUpdateRequest
221
+ );
222
+ ```
223
+
224
+ ### Parameters
225
+
226
+ |Name | Type | Description | Notes|
227
+ |------------- | ------------- | ------------- | -------------|
228
+ | **v1FoldersUpdateRequest** | **V1FoldersUpdateRequest**| | |
229
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
230
+ | **folder** | [**string**] | Current folder path (URL-encoded). | defaults to undefined|
231
+
232
+
233
+ ### Return type
234
+
235
+ **V1FoldersResource**
236
+
237
+ ### Authorization
238
+
239
+ [BearerAuth](../README.md#BearerAuth)
240
+
241
+ ### HTTP request headers
242
+
243
+ - **Content-Type**: application/json
244
+ - **Accept**: application/json
245
+
246
+
247
+ ### HTTP response details
248
+ | Status code | Description | Response headers |
249
+ |-------------|-------------|------------------|
250
+ |**200** | Folder renamed. | - |
251
+ |**401** | Missing or invalid credentials. | - |
252
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
253
+ |**409** | Conflict with the target resource. | - |
254
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
255
+ |**500** | Server-side failure. | - |
256
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
257
+
258
+ [[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)
259
+