bexio 3.8.1 → 4.0.1

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 (286) hide show
  1. package/lib/index.d.mts +2983 -0
  2. package/lib/index.d.ts +2954 -55
  3. package/lib/index.js +2213 -100
  4. package/lib/index.js.map +1 -1
  5. package/lib/index.mjs +2158 -0
  6. package/lib/index.mjs.map +1 -0
  7. package/package.json +25 -6
  8. package/coverage/base.css +0 -224
  9. package/coverage/block-navigation.js +0 -87
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +0 -146
  12. package/coverage/prettify.css +0 -1
  13. package/coverage/prettify.js +0 -2
  14. package/coverage/sort-arrow-sprite.png +0 -0
  15. package/coverage/sorter.js +0 -210
  16. package/jest-html-reporters-attach/jest_html_reporters/index.js +0 -3
  17. package/jest-html-reporters-attach/jest_html_reporters/result.js +0 -1
  18. package/jest_html_reporters.html +0 -1
  19. package/junit.xml +0 -339
  20. package/lib/interfaces/AccountsStatic.d.ts +0 -14
  21. package/lib/interfaces/AccountsStatic.js +0 -3
  22. package/lib/interfaces/AccountsStatic.js.map +0 -1
  23. package/lib/interfaces/BankAccountsStatic.d.ts +0 -25
  24. package/lib/interfaces/BankAccountsStatic.js +0 -3
  25. package/lib/interfaces/BankAccountsStatic.js.map +0 -1
  26. package/lib/interfaces/BaseStatic.d.ts +0 -20
  27. package/lib/interfaces/BaseStatic.js +0 -3
  28. package/lib/interfaces/BaseStatic.js.map +0 -1
  29. package/lib/interfaces/BillsStatic.d.ts +0 -167
  30. package/lib/interfaces/BillsStatic.js +0 -25
  31. package/lib/interfaces/BillsStatic.js.map +0 -1
  32. package/lib/interfaces/BillsV4Static.d.ts +0 -204
  33. package/lib/interfaces/BillsV4Static.js +0 -60
  34. package/lib/interfaces/BillsV4Static.js.map +0 -1
  35. package/lib/interfaces/BusinessActivitiesStatic.d.ts +0 -24
  36. package/lib/interfaces/BusinessActivitiesStatic.js +0 -11
  37. package/lib/interfaces/BusinessActivitiesStatic.js.map +0 -1
  38. package/lib/interfaces/CalendarStatic.d.ts +0 -30
  39. package/lib/interfaces/CalendarStatic.js +0 -18
  40. package/lib/interfaces/CalendarStatic.js.map +0 -1
  41. package/lib/interfaces/ContactGroupsStatic.d.ts +0 -12
  42. package/lib/interfaces/ContactGroupsStatic.js +0 -11
  43. package/lib/interfaces/ContactGroupsStatic.js.map +0 -1
  44. package/lib/interfaces/ContactRelationsStatic.d.ts +0 -24
  45. package/lib/interfaces/ContactRelationsStatic.js +0 -13
  46. package/lib/interfaces/ContactRelationsStatic.js.map +0 -1
  47. package/lib/interfaces/ContactSectorsStatic.d.ts +0 -9
  48. package/lib/interfaces/ContactSectorsStatic.js +0 -11
  49. package/lib/interfaces/ContactSectorsStatic.js.map +0 -1
  50. package/lib/interfaces/ContactTypesStatic.d.ts +0 -9
  51. package/lib/interfaces/ContactTypesStatic.js +0 -11
  52. package/lib/interfaces/ContactTypesStatic.js.map +0 -1
  53. package/lib/interfaces/ContactsStatic.d.ts +0 -118
  54. package/lib/interfaces/ContactsStatic.js +0 -27
  55. package/lib/interfaces/ContactsStatic.js.map +0 -1
  56. package/lib/interfaces/CurrenciesStatic.d.ts +0 -20
  57. package/lib/interfaces/CurrenciesStatic.js +0 -3
  58. package/lib/interfaces/CurrenciesStatic.js.map +0 -1
  59. package/lib/interfaces/ExpensesStatic.d.ts +0 -83
  60. package/lib/interfaces/ExpensesStatic.js +0 -25
  61. package/lib/interfaces/ExpensesStatic.js.map +0 -1
  62. package/lib/interfaces/InvoicesStatic.d.ts +0 -162
  63. package/lib/interfaces/InvoicesStatic.js +0 -46
  64. package/lib/interfaces/InvoicesStatic.js.map +0 -1
  65. package/lib/interfaces/ItemsStatic.d.ts +0 -120
  66. package/lib/interfaces/ItemsStatic.js +0 -47
  67. package/lib/interfaces/ItemsStatic.js.map +0 -1
  68. package/lib/interfaces/ManualEntriesStatic.d.ts +0 -42
  69. package/lib/interfaces/ManualEntriesStatic.js +0 -3
  70. package/lib/interfaces/ManualEntriesStatic.js.map +0 -1
  71. package/lib/interfaces/NotesStatic.d.ts +0 -23
  72. package/lib/interfaces/NotesStatic.js +0 -16
  73. package/lib/interfaces/NotesStatic.js.map +0 -1
  74. package/lib/interfaces/OrdersStatic.d.ts +0 -117
  75. package/lib/interfaces/OrdersStatic.js +0 -25
  76. package/lib/interfaces/OrdersStatic.js.map +0 -1
  77. package/lib/interfaces/OutgoingPaymentsStatic.d.ts +0 -142
  78. package/lib/interfaces/OutgoingPaymentsStatic.js +0 -39
  79. package/lib/interfaces/OutgoingPaymentsStatic.js.map +0 -1
  80. package/lib/interfaces/PaymentsStatic.d.ts +0 -22
  81. package/lib/interfaces/PaymentsStatic.js +0 -3
  82. package/lib/interfaces/PaymentsStatic.js.map +0 -1
  83. package/lib/interfaces/PositionStatic.d.ts +0 -35
  84. package/lib/interfaces/PositionStatic.js +0 -3
  85. package/lib/interfaces/PositionStatic.js.map +0 -1
  86. package/lib/interfaces/PositionsStatic.d.ts +0 -46
  87. package/lib/interfaces/PositionsStatic.js +0 -3
  88. package/lib/interfaces/PositionsStatic.js.map +0 -1
  89. package/lib/interfaces/ProjectStatusesStatic.d.ts +0 -9
  90. package/lib/interfaces/ProjectStatusesStatic.js +0 -11
  91. package/lib/interfaces/ProjectStatusesStatic.js.map +0 -1
  92. package/lib/interfaces/ProjectTypesStatic.d.ts +0 -9
  93. package/lib/interfaces/ProjectTypesStatic.js +0 -11
  94. package/lib/interfaces/ProjectTypesStatic.js.map +0 -1
  95. package/lib/interfaces/ProjectsStatic.d.ts +0 -55
  96. package/lib/interfaces/ProjectsStatic.js +0 -13
  97. package/lib/interfaces/ProjectsStatic.js.map +0 -1
  98. package/lib/interfaces/SalesOrderManagementStatic.d.ts +0 -289
  99. package/lib/interfaces/SalesOrderManagementStatic.js +0 -69
  100. package/lib/interfaces/SalesOrderManagementStatic.js.map +0 -1
  101. package/lib/interfaces/TaxesStatic.d.ts +0 -31
  102. package/lib/interfaces/TaxesStatic.js +0 -3
  103. package/lib/interfaces/TaxesStatic.js.map +0 -1
  104. package/lib/interfaces/TimetrackingStatusesStatic.d.ts +0 -9
  105. package/lib/interfaces/TimetrackingStatusesStatic.js +0 -11
  106. package/lib/interfaces/TimetrackingStatusesStatic.js.map +0 -1
  107. package/lib/interfaces/TimetrackingsStatic.d.ts +0 -69
  108. package/lib/interfaces/TimetrackingsStatic.js +0 -16
  109. package/lib/interfaces/TimetrackingsStatic.js.map +0 -1
  110. package/lib/interfaces/UsersStatic.d.ts +0 -23
  111. package/lib/interfaces/UsersStatic.js +0 -15
  112. package/lib/interfaces/UsersStatic.js.map +0 -1
  113. package/lib/resources/Accounts.d.ts +0 -49
  114. package/lib/resources/Accounts.js +0 -85
  115. package/lib/resources/Accounts.js.map +0 -1
  116. package/lib/resources/BankAccounts.d.ts +0 -49
  117. package/lib/resources/BankAccounts.js +0 -85
  118. package/lib/resources/BankAccounts.js.map +0 -1
  119. package/lib/resources/BaseCrud.d.ts +0 -89
  120. package/lib/resources/BaseCrud.js +0 -181
  121. package/lib/resources/BaseCrud.js.map +0 -1
  122. package/lib/resources/Bills.d.ts +0 -67
  123. package/lib/resources/Bills.js +0 -107
  124. package/lib/resources/Bills.js.map +0 -1
  125. package/lib/resources/BillsV4.d.ts +0 -52
  126. package/lib/resources/BillsV4.js +0 -86
  127. package/lib/resources/BillsV4.js.map +0 -1
  128. package/lib/resources/BusinessActivities.d.ts +0 -5
  129. package/lib/resources/BusinessActivities.js +0 -13
  130. package/lib/resources/BusinessActivities.js.map +0 -1
  131. package/lib/resources/ContactGroups.d.ts +0 -13
  132. package/lib/resources/ContactGroups.js +0 -34
  133. package/lib/resources/ContactGroups.js.map +0 -1
  134. package/lib/resources/ContactRelations.d.ts +0 -5
  135. package/lib/resources/ContactRelations.js +0 -13
  136. package/lib/resources/ContactRelations.js.map +0 -1
  137. package/lib/resources/ContactSectors.d.ts +0 -39
  138. package/lib/resources/ContactSectors.js +0 -72
  139. package/lib/resources/ContactSectors.js.map +0 -1
  140. package/lib/resources/ContactTypes.d.ts +0 -39
  141. package/lib/resources/ContactTypes.js +0 -72
  142. package/lib/resources/ContactTypes.js.map +0 -1
  143. package/lib/resources/Contacts.d.ts +0 -5
  144. package/lib/resources/Contacts.js +0 -13
  145. package/lib/resources/Contacts.js.map +0 -1
  146. package/lib/resources/Currencies.d.ts +0 -33
  147. package/lib/resources/Currencies.js +0 -61
  148. package/lib/resources/Currencies.js.map +0 -1
  149. package/lib/resources/DefaultPositions.d.ts +0 -33
  150. package/lib/resources/DefaultPositions.js +0 -61
  151. package/lib/resources/DefaultPositions.js.map +0 -1
  152. package/lib/resources/Expenses.d.ts +0 -5
  153. package/lib/resources/Expenses.js +0 -13
  154. package/lib/resources/Expenses.js.map +0 -1
  155. package/lib/resources/Invoices.d.ts +0 -113
  156. package/lib/resources/Invoices.js +0 -189
  157. package/lib/resources/Invoices.js.map +0 -1
  158. package/lib/resources/ItemPositions.d.ts +0 -33
  159. package/lib/resources/ItemPositions.js +0 -61
  160. package/lib/resources/ItemPositions.js.map +0 -1
  161. package/lib/resources/Items.d.ts +0 -5
  162. package/lib/resources/Items.js +0 -13
  163. package/lib/resources/Items.js.map +0 -1
  164. package/lib/resources/ManualEntries.d.ts +0 -50
  165. package/lib/resources/ManualEntries.js +0 -84
  166. package/lib/resources/ManualEntries.js.map +0 -1
  167. package/lib/resources/Orders.d.ts +0 -33
  168. package/lib/resources/Orders.js +0 -64
  169. package/lib/resources/Orders.js.map +0 -1
  170. package/lib/resources/OutgoingPayments.d.ts +0 -63
  171. package/lib/resources/OutgoingPayments.js +0 -117
  172. package/lib/resources/OutgoingPayments.js.map +0 -1
  173. package/lib/resources/Payments.d.ts +0 -36
  174. package/lib/resources/Payments.js +0 -64
  175. package/lib/resources/Payments.js.map +0 -1
  176. package/lib/resources/ProjectStatuses.d.ts +0 -39
  177. package/lib/resources/ProjectStatuses.js +0 -72
  178. package/lib/resources/ProjectStatuses.js.map +0 -1
  179. package/lib/resources/ProjectTypes.d.ts +0 -39
  180. package/lib/resources/ProjectTypes.js +0 -72
  181. package/lib/resources/ProjectTypes.js.map +0 -1
  182. package/lib/resources/Projects.d.ts +0 -5
  183. package/lib/resources/Projects.js +0 -13
  184. package/lib/resources/Projects.js.map +0 -1
  185. package/lib/resources/Taxes.d.ts +0 -30
  186. package/lib/resources/Taxes.js +0 -70
  187. package/lib/resources/Taxes.js.map +0 -1
  188. package/lib/resources/TextPositions.d.ts +0 -33
  189. package/lib/resources/TextPositions.js +0 -61
  190. package/lib/resources/TextPositions.js.map +0 -1
  191. package/lib/resources/TimetrackingStatuses.d.ts +0 -39
  192. package/lib/resources/TimetrackingStatuses.js +0 -72
  193. package/lib/resources/TimetrackingStatuses.js.map +0 -1
  194. package/lib/resources/Timetrackings.d.ts +0 -14
  195. package/lib/resources/Timetrackings.js +0 -35
  196. package/lib/resources/Timetrackings.js.map +0 -1
  197. package/lib/resources/Users.d.ts +0 -39
  198. package/lib/resources/Users.js +0 -72
  199. package/lib/resources/Users.js.map +0 -1
  200. package/lib/tests/Accounts.test.d.ts +0 -1
  201. package/lib/tests/Accounts.test.js +0 -86
  202. package/lib/tests/Accounts.test.js.map +0 -1
  203. package/lib/tests/BankAccounts.test.d.ts +0 -1
  204. package/lib/tests/BankAccounts.test.js +0 -86
  205. package/lib/tests/BankAccounts.test.js.map +0 -1
  206. package/lib/tests/BaseCrud.test.d.ts +0 -1
  207. package/lib/tests/BaseCrud.test.js +0 -302
  208. package/lib/tests/BaseCrud.test.js.map +0 -1
  209. package/lib/tests/Bills.test.d.ts +0 -1
  210. package/lib/tests/Bills.test.js +0 -110
  211. package/lib/tests/Bills.test.js.map +0 -1
  212. package/lib/tests/BillsV4.test.d.ts +0 -1
  213. package/lib/tests/BillsV4.test.js +0 -134
  214. package/lib/tests/BillsV4.test.js.map +0 -1
  215. package/lib/tests/BusinessActivities.test.d.ts +0 -1
  216. package/lib/tests/BusinessActivities.test.js +0 -21
  217. package/lib/tests/BusinessActivities.test.js.map +0 -1
  218. package/lib/tests/ContactGroups.test.d.ts +0 -1
  219. package/lib/tests/ContactGroups.test.js +0 -21
  220. package/lib/tests/ContactGroups.test.js.map +0 -1
  221. package/lib/tests/ContactRelations.test.d.ts +0 -1
  222. package/lib/tests/ContactRelations.test.js +0 -21
  223. package/lib/tests/ContactRelations.test.js.map +0 -1
  224. package/lib/tests/ContactSectors.test.d.ts +0 -1
  225. package/lib/tests/ContactSectors.test.js +0 -21
  226. package/lib/tests/ContactSectors.test.js.map +0 -1
  227. package/lib/tests/ContactTypes.test.d.ts +0 -1
  228. package/lib/tests/ContactTypes.test.js +0 -21
  229. package/lib/tests/ContactTypes.test.js.map +0 -1
  230. package/lib/tests/Contacts.test.d.ts +0 -1
  231. package/lib/tests/Contacts.test.js +0 -21
  232. package/lib/tests/Contacts.test.js.map +0 -1
  233. package/lib/tests/Currencies.test.d.ts +0 -1
  234. package/lib/tests/Currencies.test.js +0 -21
  235. package/lib/tests/Currencies.test.js.map +0 -1
  236. package/lib/tests/DefaultPositions.test.d.ts +0 -1
  237. package/lib/tests/DefaultPositions.test.js +0 -22
  238. package/lib/tests/DefaultPositions.test.js.map +0 -1
  239. package/lib/tests/Expenses.test.d.ts +0 -1
  240. package/lib/tests/Expenses.test.js +0 -21
  241. package/lib/tests/Expenses.test.js.map +0 -1
  242. package/lib/tests/Invoices.test.d.ts +0 -1
  243. package/lib/tests/Invoices.test.js +0 -207
  244. package/lib/tests/Invoices.test.js.map +0 -1
  245. package/lib/tests/ItemPositions.test.d.ts +0 -1
  246. package/lib/tests/ItemPositions.test.js +0 -22
  247. package/lib/tests/ItemPositions.test.js.map +0 -1
  248. package/lib/tests/Items.test.d.ts +0 -1
  249. package/lib/tests/Items.test.js +0 -21
  250. package/lib/tests/Items.test.js.map +0 -1
  251. package/lib/tests/ManualEntries.test.d.ts +0 -1
  252. package/lib/tests/ManualEntries.test.js +0 -116
  253. package/lib/tests/ManualEntries.test.js.map +0 -1
  254. package/lib/tests/Orders.test.d.ts +0 -1
  255. package/lib/tests/Orders.test.js +0 -137
  256. package/lib/tests/Orders.test.js.map +0 -1
  257. package/lib/tests/OutgoingPayments.test.d.ts +0 -1
  258. package/lib/tests/OutgoingPayments.test.js +0 -125
  259. package/lib/tests/OutgoingPayments.test.js.map +0 -1
  260. package/lib/tests/Payments.test.d.ts +0 -1
  261. package/lib/tests/Payments.test.js +0 -22
  262. package/lib/tests/Payments.test.js.map +0 -1
  263. package/lib/tests/ProjectStatuses.test.d.ts +0 -1
  264. package/lib/tests/ProjectStatuses.test.js +0 -21
  265. package/lib/tests/ProjectStatuses.test.js.map +0 -1
  266. package/lib/tests/ProjectTypes.test.d.ts +0 -1
  267. package/lib/tests/ProjectTypes.test.js +0 -21
  268. package/lib/tests/ProjectTypes.test.js.map +0 -1
  269. package/lib/tests/Projects.test.d.ts +0 -1
  270. package/lib/tests/Projects.test.js +0 -21
  271. package/lib/tests/Projects.test.js.map +0 -1
  272. package/lib/tests/Taxes.test.d.ts +0 -1
  273. package/lib/tests/Taxes.test.js +0 -107
  274. package/lib/tests/Taxes.test.js.map +0 -1
  275. package/lib/tests/TextPositions.test.d.ts +0 -1
  276. package/lib/tests/TextPositions.test.js +0 -22
  277. package/lib/tests/TextPositions.test.js.map +0 -1
  278. package/lib/tests/TimetrackingStatuses.test.d.ts +0 -1
  279. package/lib/tests/TimetrackingStatuses.test.js +0 -21
  280. package/lib/tests/TimetrackingStatuses.test.js.map +0 -1
  281. package/lib/tests/Timetrackings.test.d.ts +0 -1
  282. package/lib/tests/Timetrackings.test.js +0 -21
  283. package/lib/tests/Timetrackings.test.js.map +0 -1
  284. package/lib/tests/Users.test.d.ts +0 -1
  285. package/lib/tests/Users.test.js +0 -21
  286. package/lib/tests/Users.test.js.map +0 -1
package/lib/index.mjs ADDED
@@ -0,0 +1,2158 @@
1
+ // src/resources/BaseCrud.ts
2
+ import axios from "axios";
3
+ var BaseCrud = class {
4
+ constructor(apiToken, apiEndpoint) {
5
+ this.baseApiUrl = "https://api.bexio.com";
6
+ this.apiToken = apiToken;
7
+ this.apiEndpoint = apiEndpoint;
8
+ }
9
+ /**
10
+ * Lists the ressource
11
+ *
12
+ * @param {BaseStatic.BaseOptions} [options]
13
+ * @returns {Promise<Array<T>>}
14
+ * @memberof BaseCrud
15
+ */
16
+ async list(options) {
17
+ return this.request("GET", this.apiEndpoint, options);
18
+ }
19
+ /**
20
+ * search for resources
21
+ *
22
+ * @param {Array<BaseStatic.SearchParameter<SearchType>>} searchOptions
23
+ * @param {BaseStatic.BaseOptions} [options]
24
+ * @returns {Promise<Array<Search>>}
25
+ * @memberof BaseCrud
26
+ */
27
+ async search(searchOptions, options) {
28
+ return this.request(
29
+ "POST",
30
+ this.apiEndpoint + "/search",
31
+ options,
32
+ searchOptions
33
+ );
34
+ }
35
+ /**
36
+ * show a specific ressource
37
+ *
38
+ * @param {string | number} id
39
+ * @param {BaseStatic.BaseOptions} [options]
40
+ * @returns {Promise<Full>}
41
+ * @memberof BaseCrud
42
+ */
43
+ async show(id, options) {
44
+ return this.request("GET", this.apiEndpoint + "/" + id, options);
45
+ }
46
+ /**
47
+ * create a new ressource
48
+ *
49
+ * @param {Full} ressource
50
+ * @returns {Promise<Full>}
51
+ * @memberof BaseCrud
52
+ */
53
+ async create(ressource) {
54
+ return this.request("POST", this.apiEndpoint, void 0, ressource);
55
+ }
56
+ /**
57
+ * overwrite an existing ressource
58
+ *
59
+ * @param {number} id
60
+ * @param {Overwrite} ressource
61
+ * @returns {Promise<Full>}
62
+ * @memberof BaseCrud
63
+ */
64
+ async overwrite(id, ressource) {
65
+ return this.request(
66
+ "PUT",
67
+ this.apiEndpoint + "/" + id,
68
+ void 0,
69
+ ressource
70
+ );
71
+ }
72
+ /**
73
+ * edit an existing ressource
74
+ *
75
+ * @param {number} id
76
+ * @param {Partial<Overwrite>} ressource
77
+ * @returns {Promise<Full>}
78
+ * @memberof BaseCrud
79
+ */
80
+ async edit(id, ressource) {
81
+ return this.request(
82
+ "POST",
83
+ this.apiEndpoint + "/" + id,
84
+ void 0,
85
+ ressource
86
+ );
87
+ }
88
+ /**
89
+ * delete an ressource
90
+ *
91
+ * @param {string | number} id
92
+ * @returns {Promise<boolean>}
93
+ * @memberof BaseCrud
94
+ */
95
+ async delete(id) {
96
+ return (await this.request(
97
+ "DELETE",
98
+ this.apiEndpoint + "/" + id
99
+ )).success;
100
+ }
101
+ /**
102
+ * Base request to the api
103
+ *
104
+ * @protected
105
+ * @template T
106
+ * @param {string} method
107
+ * @param {string} path
108
+ * @param {BaseStatic.BaseOptions} [options]
109
+ * @param {*} [data]
110
+ * @returns {Promise<T>}
111
+ * @memberof Bexio
112
+ */
113
+ async request(method, path, options, data) {
114
+ let requestOptions = {
115
+ method,
116
+ url: this.baseApiUrl + path + this.optionsToQuery(options),
117
+ headers: {
118
+ Authorization: `Bearer ${this.apiToken}`,
119
+ "Content-Type": "application/json",
120
+ Accept: "application/json"
121
+ }
122
+ };
123
+ if (data) {
124
+ requestOptions.data = data;
125
+ }
126
+ try {
127
+ const reponse = await axios.request(requestOptions);
128
+ return reponse.data;
129
+ } catch (e) {
130
+ const error = e;
131
+ return Promise.reject({
132
+ code: error.response?.status,
133
+ message: error.response?.data
134
+ });
135
+ }
136
+ }
137
+ /**
138
+ * Generates the querystring out of the options
139
+ *
140
+ * @protected
141
+ * @param {BaseStatic.BaseOptions} [options]
142
+ * @returns {string}
143
+ * @memberof Bexio
144
+ */
145
+ optionsToQuery(options) {
146
+ let str = [];
147
+ if (!options) {
148
+ return "";
149
+ }
150
+ for (let i in options) {
151
+ if (options.hasOwnProperty(i)) {
152
+ const value = options[i];
153
+ if (Array.isArray(value)) {
154
+ value.forEach((v) => {
155
+ str.push(encodeURIComponent(i) + "=" + encodeURIComponent(v));
156
+ });
157
+ } else {
158
+ str.push(encodeURIComponent(i) + "=" + encodeURIComponent(value));
159
+ }
160
+ }
161
+ }
162
+ return `?${str.join("&")}`;
163
+ }
164
+ };
165
+
166
+ // src/resources/BusinessActivities.ts
167
+ var ClientServices = class extends BaseCrud {
168
+ constructor(apiToken) {
169
+ super(apiToken, "/2.0/client_service");
170
+ }
171
+ };
172
+
173
+ // src/resources/Contacts.ts
174
+ var Contacts = class extends BaseCrud {
175
+ constructor(apiToken) {
176
+ super(apiToken, "/2.0/contact");
177
+ }
178
+ };
179
+
180
+ // src/resources/ContactTypes.ts
181
+ var ContactTypes = class extends BaseCrud {
182
+ constructor(apiToken) {
183
+ super(apiToken, "/2.0/contact_type");
184
+ }
185
+ /**
186
+ * Not implemented by Bexio yet
187
+ *
188
+ * @param {{}} ressource
189
+ * @returns {Promise<ContactTypesStatic.ContactSector>}
190
+ * @memberof ContactTypes
191
+ */
192
+ async create(ressource) {
193
+ throw new Error("not implemented by Bexio yet");
194
+ }
195
+ /**
196
+ * Not implemented by Bexio yet
197
+ *
198
+ * @param {number} id
199
+ * @param {{}} ressource
200
+ * @returns {Promise<ContactTypesStatic.ContactSector>}
201
+ * @memberof ContactTypes
202
+ */
203
+ async edit(id, ressource) {
204
+ throw new Error("not implemented by Bexio yet");
205
+ }
206
+ /**
207
+ * Not implemented by Bexio yet
208
+ *
209
+ * @param {number} id
210
+ * @param {{}} ressource
211
+ * @returns {Promise<ContactTypesStatic.ContactSector>}
212
+ * @memberof ContactTypes
213
+ */
214
+ async overwrite(id, ressource) {
215
+ throw new Error("not implemented by Bexio yet");
216
+ }
217
+ /**
218
+ * Not implemented by Bexio yet
219
+ *
220
+ * @param {number} id
221
+ * @returns {Promise<boolean>}
222
+ * @memberof ContactTypes
223
+ */
224
+ async delete(id) {
225
+ throw new Error("not implemented by Bexio yet");
226
+ }
227
+ };
228
+
229
+ // src/resources/ContactSectors.ts
230
+ var ContactSectors = class extends BaseCrud {
231
+ constructor(apiToken) {
232
+ super(apiToken, "/2.0/contact_branch");
233
+ }
234
+ /**
235
+ * Not implemented by Bexio yet
236
+ *
237
+ * @param {{}} ressource
238
+ * @returns {Promise<ContactSectorsStatic.ContactSector>}
239
+ * @memberof ContactSectors
240
+ */
241
+ async create(ressource) {
242
+ throw new Error("not implemented by Bexio yet");
243
+ }
244
+ /**
245
+ * Not implemented by Bexio yet
246
+ *
247
+ * @param {number} id
248
+ * @param {{}} ressource
249
+ * @returns {Promise<ContactSectorsStatic.ContactSector>}
250
+ * @memberof ContactSectors
251
+ */
252
+ async edit(id, ressource) {
253
+ throw new Error("not implemented by Bexio yet");
254
+ }
255
+ /**
256
+ * Not implemented by Bexio yet
257
+ *
258
+ * @param {number} id
259
+ * @param {{}} ressource
260
+ * @returns {Promise<ContactSectorsStatic.ContactSector>}
261
+ * @memberof ContactSectors
262
+ */
263
+ async overwrite(id, ressource) {
264
+ throw new Error("not implemented by Bexio yet");
265
+ }
266
+ /**
267
+ * Not implemented by Bexio yet
268
+ *
269
+ * @param {number} id
270
+ * @returns {Promise<boolean>}
271
+ * @memberof ContactSectors
272
+ */
273
+ async delete(id) {
274
+ throw new Error("not implemented by Bexio yet");
275
+ }
276
+ };
277
+
278
+ // src/resources/ContactGroups.ts
279
+ var ContactGroups = class extends BaseCrud {
280
+ constructor(apiToken) {
281
+ super(apiToken, "/2.0/contact_group");
282
+ }
283
+ /**
284
+ * Not implemented by Bexio yet
285
+ *
286
+ * @param {number} id
287
+ * @returns {Promise<boolean>}
288
+ * @memberof ContactGroups
289
+ */
290
+ async delete(id) {
291
+ throw new Error("not implemented by Bexio yet");
292
+ }
293
+ };
294
+
295
+ // src/resources/ContactRelations.ts
296
+ var ContactRelations = class extends BaseCrud {
297
+ constructor(apiToken) {
298
+ super(apiToken, "/2.0/contact_relation");
299
+ }
300
+ };
301
+
302
+ // src/resources/Expenses.ts
303
+ var Expenses = class extends BaseCrud {
304
+ constructor(apiToken) {
305
+ super(apiToken, "/2.0/kb_expense");
306
+ }
307
+ };
308
+
309
+ // src/resources/Payments.ts
310
+ var Payments = class extends BaseCrud {
311
+ constructor(apiToken, billId) {
312
+ super(apiToken, `/2.0/kb_bill/${billId}/payment`);
313
+ }
314
+ /**
315
+ * Not implemented by Bexio yet
316
+ *
317
+ * @param {BaseStatic.BaseOptions} options
318
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
319
+ * @returns {Promise<Array<{}>>}
320
+ * @memberof Payments
321
+ */
322
+ async search(options, searchOptions) {
323
+ throw new Error("not implemented by Bexio yet");
324
+ }
325
+ /**
326
+ * Not implemented by Bexio yet
327
+ *
328
+ * @param {number} id
329
+ * @param {{}} ressource
330
+ * @returns {Promise<PaymentsStatic.Payment>}
331
+ * @memberof Payments
332
+ */
333
+ async overwrite(id, ressource) {
334
+ throw new Error("not implemented by Bexio yet");
335
+ }
336
+ /**
337
+ * Not implemented by Bexio yet
338
+ *
339
+ * @param {number} id
340
+ * @param {Partial<{}>} ressource
341
+ * @returns {Promise<PaymentsStatic.Payment>}
342
+ * @memberof Payments
343
+ */
344
+ async edit(id, ressource) {
345
+ throw new Error("not implemented by Bexio yet");
346
+ }
347
+ };
348
+
349
+ // src/resources/Bills.ts
350
+ var Bills = class extends BaseCrud {
351
+ constructor(apiToken) {
352
+ super(apiToken, "/2.0/kb_bill");
353
+ }
354
+ /**
355
+ * issue a bill
356
+ *
357
+ * @param {number} id
358
+ * @returns {Promise<{ success: boolean }>}
359
+ * @memberof Bills
360
+ */
361
+ async issue(id) {
362
+ return this.request(
363
+ "POST",
364
+ `${this.apiEndpoint}/${id.toString()}/issue`
365
+ );
366
+ }
367
+ /**
368
+ * revert a bill issue
369
+ *
370
+ * @param {number} id
371
+ * @returns {Promise<{ success: boolean }>}
372
+ * @memberof Bills
373
+ */
374
+ async revertIssue(id) {
375
+ return this.request(
376
+ "POST",
377
+ `${this.apiEndpoint}/${id.toString()}/revert_issue`
378
+ );
379
+ }
380
+ /**
381
+ * List all payments for this bill
382
+ *
383
+ * @param {number} billId
384
+ * @param {BaseStatic.BaseOptions} [options]
385
+ * @returns {Promise<PaymentsStatic.Payment[]>}
386
+ * @memberof Bills
387
+ */
388
+ async listPayments(billId, options) {
389
+ const paymentCrud = new Payments(this.apiToken, billId);
390
+ return paymentCrud.list(options);
391
+ }
392
+ /**
393
+ * Show a specific payment for this bill
394
+ *
395
+ * @param {number} billId
396
+ * @param {number} paymentId
397
+ * @param {BaseStatic.BaseOptions} [options]
398
+ * @returns {Promise<PaymentsStatic.Payment>}
399
+ * @memberof Bills
400
+ */
401
+ async showPayment(billId, paymentId, options) {
402
+ const paymentCrud = new Payments(this.apiToken, billId);
403
+ return paymentCrud.show(paymentId, options);
404
+ }
405
+ /**
406
+ * Create a new payment for this bill
407
+ *
408
+ * @param {number} billId
409
+ * @param {PaymentsStatic.PaymentCreate} payment
410
+ * @returns {Promise<PaymentsStatic.Payment>}
411
+ * @memberof Bills
412
+ */
413
+ async createPayment(billId, payment) {
414
+ const paymentCrud = new Payments(this.apiToken, billId);
415
+ return paymentCrud.create(payment);
416
+ }
417
+ /**
418
+ * delete a specific payment for this bill
419
+ *
420
+ * @param {number} billId
421
+ * @param {number} paymentId
422
+ * @returns {Promise<boolean>}
423
+ * @memberof Bills
424
+ */
425
+ async deletePayment(billId, paymentId) {
426
+ const paymentCrud = new Payments(this.apiToken, billId);
427
+ return paymentCrud.delete(paymentId);
428
+ }
429
+ };
430
+
431
+ // src/resources/DefaultPositions.ts
432
+ var DefaultPositions = class extends BaseCrud {
433
+ constructor(apiToken, documentType, documentId) {
434
+ super(
435
+ apiToken,
436
+ `/2.0/${documentType}/${documentId}/kb_position_custom`
437
+ );
438
+ }
439
+ /**
440
+ * Not implemented by Bexio yet
441
+ *
442
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
443
+ * @param {BaseStatic.BaseOptions} [options]
444
+ * @returns {Promise<Array<{}>>}
445
+ * @memberof DefaultPositions
446
+ */
447
+ async search(searchOptions, options) {
448
+ throw new Error("not implemented by Bexio yet");
449
+ }
450
+ /**
451
+ * Not implemented by Bexio yet
452
+ *
453
+ * @param {number} id
454
+ * @param {{}} ressource
455
+ * @returns {Promise<PositionsStatic.DefaultPosition>}
456
+ * @memberof DefaultPositions
457
+ */
458
+ async overwrite(id, ressource) {
459
+ throw new Error("not implemented by Bexio yet");
460
+ }
461
+ /**
462
+ * Not implemented by Bexio yet
463
+ *
464
+ * @param {number} id
465
+ * @param {Partial<{}>} ressource
466
+ * @returns {Promise<PositionsStatic.DefaultPosition>}
467
+ * @memberof DefaultPositions
468
+ */
469
+ async edit(id, ressource) {
470
+ throw new Error("not implemented by Bexio yet");
471
+ }
472
+ };
473
+
474
+ // src/resources/ItemPositions.ts
475
+ var ItemPositions = class extends BaseCrud {
476
+ constructor(apiToken, documentType, documentId) {
477
+ super(
478
+ apiToken,
479
+ `/2.0/${documentType}/${documentId}/kb_position_article`
480
+ );
481
+ }
482
+ /**
483
+ * Not implemented by Bexio yet
484
+ *
485
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
486
+ * @param {BaseStatic.BaseOptions} [options]
487
+ * @returns {Promise<Array<{}>>}
488
+ * @memberof ItemPositions
489
+ */
490
+ async search(searchOptions, options) {
491
+ throw new Error("not implemented by Bexio yet");
492
+ }
493
+ /**
494
+ * Not implemented by Bexio yet
495
+ *
496
+ * @param {number} id
497
+ * @param {{}} ressource
498
+ * @returns {Promise<PositionsStatic.ItemPosition>}
499
+ * @memberof ItemPositions
500
+ */
501
+ async overwrite(id, ressource) {
502
+ throw new Error("not implemented by Bexio yet");
503
+ }
504
+ /**
505
+ * Not implemented by Bexio yet
506
+ *
507
+ * @param {number} id
508
+ * @param {Partial<{}>} ressource
509
+ * @returns {Promise<PositionsStatic.ItemPosition>}
510
+ * @memberof ItemPositions
511
+ */
512
+ async edit(id, ressource) {
513
+ throw new Error("not implemented by Bexio yet");
514
+ }
515
+ };
516
+
517
+ // src/resources/TextPositions.ts
518
+ var TextPositions = class extends BaseCrud {
519
+ constructor(apiToken, documentType, documentId) {
520
+ super(
521
+ apiToken,
522
+ `/2.0/${documentType}/${documentId}/kb_position_text`
523
+ );
524
+ }
525
+ /**
526
+ * Not implemented by Bexio yet
527
+ *
528
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
529
+ * @param {BaseStatic.BaseOptions} [options]
530
+ * @returns {Promise<Array<{}>>}
531
+ * @memberof TextPositions
532
+ */
533
+ async search(searchOptions, options) {
534
+ throw new Error("not implemented by Bexio yet");
535
+ }
536
+ /**
537
+ * Not implemented by Bexio yet
538
+ *
539
+ * @param {number} id
540
+ * @param {{}} ressource
541
+ * @returns {Promise<PositionsStatic.TextPosition>}
542
+ * @memberof TextPositions
543
+ */
544
+ async overwrite(id, ressource) {
545
+ throw new Error("not implemented by Bexio yet");
546
+ }
547
+ /**
548
+ * Not implemented by Bexio yet
549
+ *
550
+ * @param {number} id
551
+ * @param {Partial<{}>} ressource
552
+ * @returns {Promise<PositionsStatic.TextPosition>}
553
+ * @memberof TextPositions
554
+ */
555
+ async edit(id, ressource) {
556
+ throw new Error("not implemented by Bexio yet");
557
+ }
558
+ };
559
+
560
+ // src/resources/Positions.ts
561
+ var Positions = class _Positions extends BaseCrud {
562
+ static {
563
+ this.endpoints = {
564
+ KbPositionCustom: "kb_position_custom",
565
+ KbPositionArticle: "kb_position_article",
566
+ KbPositionText: "kb_position_text",
567
+ KbPositionSubtotal: "kb_position_subtotal",
568
+ KbPositionPagebreak: "kb_position_pagebreak",
569
+ KbPositionDiscount: "kb_position_discount",
570
+ KbPositionSubposition: "kb_position_subposition"
571
+ };
572
+ }
573
+ constructor(apiToken, documentType, documentId, positionType) {
574
+ super(
575
+ apiToken,
576
+ `/2.0/${documentType}/${documentId}/${_Positions.endpoint(positionType)}`
577
+ );
578
+ }
579
+ /**
580
+ * Endpoint segment of a position type
581
+ *
582
+ * @private
583
+ * @static
584
+ * @param {PositionsStatic.PositionType} positionType
585
+ * @returns {string}
586
+ * @memberof Positions
587
+ */
588
+ static endpoint(positionType) {
589
+ if (!Object.prototype.hasOwnProperty.call(_Positions.endpoints, positionType)) {
590
+ throw new Error(`Unknown position type "${positionType}"`);
591
+ }
592
+ return _Positions.endpoints[positionType];
593
+ }
594
+ /**
595
+ * Not implemented by Bexio yet
596
+ *
597
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
598
+ * @param {BaseStatic.BaseOptions} [options]
599
+ * @returns {Promise<Array<{}>>}
600
+ * @memberof Positions
601
+ */
602
+ async search(searchOptions, options) {
603
+ throw new Error("not implemented by Bexio yet");
604
+ }
605
+ /**
606
+ * Not implemented by Bexio yet
607
+ *
608
+ * @param {number} id
609
+ * @param {{}} ressource
610
+ * @returns {Promise<PositionStatic.Position>}
611
+ * @memberof Positions
612
+ */
613
+ async overwrite(id, ressource) {
614
+ throw new Error("not implemented by Bexio yet");
615
+ }
616
+ };
617
+
618
+ // src/resources/Orders.ts
619
+ var Orders = class extends BaseCrud {
620
+ constructor(apiToken) {
621
+ super(apiToken, "/2.0/kb_order");
622
+ }
623
+ /**
624
+ * Create a default position for an order
625
+ *
626
+ * @param {number} orderId
627
+ * @param {PositionsStatic.DefaultPositionCreate} position
628
+ * @returns {Promise<PositionsStatic.DefaultPosition>}
629
+ * @memberof Orders
630
+ */
631
+ async createDefaultPosition(orderId, position) {
632
+ return new DefaultPositions(this.apiToken, "kb_order", orderId).create(
633
+ position
634
+ );
635
+ }
636
+ /**
637
+ * Create an item position for an order
638
+ *
639
+ * @param {number} orderId
640
+ * @param {PositionsStatic.ItemPositionCreate} position
641
+ * @returns {Promise<PositionsStatic.ItemPosition>}
642
+ * @memberof Orders
643
+ */
644
+ async createItemPosition(orderId, position) {
645
+ return new ItemPositions(this.apiToken, "kb_order", orderId).create(
646
+ position
647
+ );
648
+ }
649
+ /**
650
+ * Create a text position for an order
651
+ *
652
+ * @param {number} orderId
653
+ * @param {PositionsStatic.TextPositionCreate} position
654
+ * @returns {Promise<PositionsStatic.TextPosition>}
655
+ * @memberof Orders
656
+ */
657
+ async createTextPosition(orderId, position) {
658
+ return new TextPositions(this.apiToken, "kb_order", orderId).create(
659
+ position
660
+ );
661
+ }
662
+ /**
663
+ * Delete a default position for an order
664
+ *
665
+ * @param {number} orderId
666
+ * @param {number} positionId
667
+ * @returns {Promise<boolean>}
668
+ * @memberof Orders
669
+ */
670
+ async deleteDefaultPosition(orderId, positionId) {
671
+ return new DefaultPositions(this.apiToken, "kb_order", orderId).delete(
672
+ positionId
673
+ );
674
+ }
675
+ /**
676
+ * Delete an item position for an order
677
+ *
678
+ * @param {number} orderId
679
+ * @param {number} positionId
680
+ * @returns {Promise<boolean>}
681
+ * @memberof Orders
682
+ */
683
+ async deleteItemPosition(orderId, positionId) {
684
+ return new ItemPositions(this.apiToken, "kb_order", orderId).delete(
685
+ positionId
686
+ );
687
+ }
688
+ /**
689
+ * Delete a text position for an order
690
+ *
691
+ * @param {number} orderId
692
+ * @param {number} positionId
693
+ * @returns {Promise<boolean>}
694
+ * @memberof Orders
695
+ */
696
+ async deleteTextPosition(orderId, positionId) {
697
+ return new TextPositions(this.apiToken, "kb_order", orderId).delete(
698
+ positionId
699
+ );
700
+ }
701
+ /**
702
+ * Delete a position for an order, whatever its type
703
+ *
704
+ * @param {number} orderId
705
+ * @param {Pick<PositionStatic.Position, "id" | "type">} position
706
+ * @returns {Promise<boolean>}
707
+ * @memberof Orders
708
+ */
709
+ async deletePosition(orderId, position) {
710
+ return new Positions(
711
+ this.apiToken,
712
+ "kb_order",
713
+ orderId,
714
+ position.type
715
+ ).delete(position.id);
716
+ }
717
+ };
718
+
719
+ // src/resources/Projects.ts
720
+ var Projects = class extends BaseCrud {
721
+ constructor(apiToken) {
722
+ super(apiToken, "/2.0/pr_project");
723
+ }
724
+ };
725
+
726
+ // src/resources/ProjectStatuses.ts
727
+ var ProjectStatuses = class extends BaseCrud {
728
+ constructor(apiToken) {
729
+ super(apiToken, "/2.0/pr_project_state");
730
+ }
731
+ /**
732
+ * Not implemented by Bexio yet
733
+ *
734
+ * @param {number} id
735
+ * @param {{}} ressource
736
+ * @returns {Promise<ProjectStatusesStatic.ProjectStatus>}
737
+ * @memberof ProjectStatuses
738
+ */
739
+ async overwrite(id, ressource) {
740
+ throw new Error("not implemented by Bexio yet");
741
+ }
742
+ /**
743
+ * Not implemented by Bexio yet
744
+ *
745
+ * @param {number} id
746
+ * @param {{}} ressource
747
+ * @returns {Promise<ProjectStatusesStatic.ProjectStatus>}
748
+ * @memberof ProjectStatuses
749
+ */
750
+ async edit(id, ressource) {
751
+ throw new Error("not implemented by Bexio yet");
752
+ }
753
+ /**
754
+ * Not implemented by Bexio yet
755
+ *
756
+ * @param {{}} ressource
757
+ * @returns {Promise<ProjectStatusesStatic.ProjectStatus>}
758
+ * @memberof ProjectStatuses
759
+ */
760
+ async create(ressource) {
761
+ throw new Error("not implemented by Bexio yet");
762
+ }
763
+ /**
764
+ * Not implemented by Bexio yet
765
+ *
766
+ * @param {number} id
767
+ * @returns {Promise<boolean>}
768
+ * @memberof ProjectStatuses
769
+ */
770
+ async delete(id) {
771
+ throw new Error("not implemented by Bexio yet");
772
+ }
773
+ };
774
+
775
+ // src/resources/ProjectTypes.ts
776
+ var ProjectTypes = class extends BaseCrud {
777
+ constructor(apiToken) {
778
+ super(apiToken, "/2.0/pr_project_type");
779
+ }
780
+ /**
781
+ * Not implemented by Bexio yet
782
+ *
783
+ * @param {{}} ressource
784
+ * @returns {Promise<ProjectTypesStatic.ProjectType>}
785
+ * @memberof ProjectTypes
786
+ */
787
+ async create(ressource) {
788
+ throw new Error("not implemented by Bexio yet");
789
+ }
790
+ /**
791
+ * Not implemented by Bexio yet
792
+ *
793
+ * @param {number} id
794
+ * @param {{}} ressource
795
+ * @returns {Promise<ProjectTypesStatic.ProjectType>}
796
+ * @memberof ProjectTypes
797
+ */
798
+ async edit(id, ressource) {
799
+ throw new Error("not implemented by Bexio yet");
800
+ }
801
+ /**
802
+ * Not implemented by Bexio yet
803
+ *
804
+ * @param {number} id
805
+ * @param {{}} ressource
806
+ * @returns {Promise<ProjectTypesStatic.ProjectType>}
807
+ * @memberof ProjectTypes
808
+ */
809
+ async overwrite(id, ressource) {
810
+ throw new Error("not implemented by Bexio yet");
811
+ }
812
+ /**
813
+ * Not implemented by Bexio yet
814
+ *
815
+ * @param {number} id
816
+ * @returns {Promise<boolean>}
817
+ * @memberof ProjectTypes
818
+ */
819
+ async delete(id) {
820
+ throw new Error("not implemented by Bexio yet");
821
+ }
822
+ };
823
+
824
+ // src/resources/Timetrackings.ts
825
+ var Timetrackings = class extends BaseCrud {
826
+ constructor(apiToken) {
827
+ super(apiToken, "/2.0/timesheet");
828
+ }
829
+ /**
830
+ * Not implemented by Bexio yet
831
+ *
832
+ * @param {number} id
833
+ * @param {{}} ressource
834
+ * @returns {Promise<TimetrackingsStatic.TimetrackingsFull>}
835
+ * @memberof Timetracking
836
+ */
837
+ async overwrite(id, ressource) {
838
+ throw new Error("not implemented by Bexio yet");
839
+ }
840
+ };
841
+
842
+ // src/resources/TimetrackingStatuses.ts
843
+ var TimetrackingStatuses = class extends BaseCrud {
844
+ constructor(apiToken) {
845
+ super(apiToken, "/2.0/timesheet_status");
846
+ }
847
+ /**
848
+ * Not implemented by Bexio yet
849
+ *
850
+ * @param {number} id
851
+ * @param {{}} ressource
852
+ * @returns {Promise<TimetrackingStatusesStatic.TimetrackingStatus>}
853
+ * @memberof TimetrackingStatuses
854
+ */
855
+ async overwrite(id, ressource) {
856
+ throw new Error("not implemented by Bexio yet");
857
+ }
858
+ /**
859
+ * Not implemented by Bexio yet
860
+ *
861
+ * @param {number} id
862
+ * @param {{}} ressource
863
+ * @returns {Promise<TimetrackingStatusesStatic.TimetrackingStatus>}
864
+ * @memberof TimetrackingStatuses
865
+ */
866
+ async edit(id, ressource) {
867
+ throw new Error("not implemented by Bexio yet");
868
+ }
869
+ /**
870
+ * Not implemented by Bexio yet
871
+ *
872
+ * @param {{}} ressource
873
+ * @returns {Promise<TimetrackingStatusesStatic.TimetrackingStatus>}
874
+ * @memberof TimetrackingStatuses
875
+ */
876
+ async create(ressource) {
877
+ throw new Error("not implemented by Bexio yet");
878
+ }
879
+ /**
880
+ * Not implemented by Bexio yet
881
+ *
882
+ * @param {number} id
883
+ * @returns {Promise<boolean>}
884
+ * @memberof TimetrackingStatuses
885
+ */
886
+ async delete(id) {
887
+ throw new Error("not implemented by Bexio yet");
888
+ }
889
+ };
890
+
891
+ // src/resources/Users.ts
892
+ var Users = class extends BaseCrud {
893
+ constructor(apiToken) {
894
+ super(apiToken, "/2.0/user");
895
+ }
896
+ /**
897
+ * Not implemented by Bexio yet
898
+ *
899
+ * @param {number} id
900
+ * @param {{}} ressource
901
+ * @returns {Promise<UsersStatic.UserFull>}
902
+ * @memberof Users
903
+ */
904
+ async overwrite(id, ressource) {
905
+ throw new Error("not implemented by Bexio yet");
906
+ }
907
+ /**
908
+ * Not implemented by Bexio yet
909
+ *
910
+ * @param {number} id
911
+ * @param {{}} ressource
912
+ * @returns {Promise<UsersStatic.UserFull>}
913
+ * @memberof Users
914
+ */
915
+ async edit(id, ressource) {
916
+ throw new Error("not implemented by Bexio yet");
917
+ }
918
+ /**
919
+ * Not implemented by Bexio yet
920
+ *
921
+ * @param {{}} ressource
922
+ * @returns {Promise<UsersStatic.UserFull>}
923
+ * @memberof Users
924
+ */
925
+ async create(ressource) {
926
+ throw new Error("not implemented by Bexio yet");
927
+ }
928
+ /**
929
+ * Not implemented by Bexio yet
930
+ *
931
+ * @param {number} id
932
+ * @returns {Promise<boolean>}
933
+ * @memberof Users
934
+ */
935
+ async delete(id) {
936
+ throw new Error("not implemented by Bexio yet");
937
+ }
938
+ };
939
+
940
+ // src/resources/Items.ts
941
+ var Items = class extends BaseCrud {
942
+ constructor(apiToken) {
943
+ super(apiToken, "/2.0/article");
944
+ }
945
+ };
946
+
947
+ // src/resources/Invoices.ts
948
+ var Invoices = class extends BaseCrud {
949
+ constructor(apiToken) {
950
+ super(apiToken, "/2.0/kb_invoice");
951
+ }
952
+ /**
953
+ * Send an invoice by email.
954
+ *
955
+ * @param {number} id
956
+ * @param {Partial<InvoicesStatic.InvoiceSend>} ressource
957
+ * @returns {Promise<InvoicesStatic.InvoiceSentAnswer>}
958
+ * @memberof Invoices
959
+ */
960
+ async send(id, ressource) {
961
+ return this.request(
962
+ "POST",
963
+ `${this.apiEndpoint}/${id}/send`,
964
+ void 0,
965
+ ressource
966
+ );
967
+ }
968
+ /**
969
+ * @deprecated Use `send` instead.
970
+ */
971
+ async sent(id, ressource) {
972
+ return this.send(id, ressource);
973
+ }
974
+ async cancel(id) {
975
+ return this.request(
976
+ "POST",
977
+ `${this.apiEndpoint}/${id}/cancel`
978
+ );
979
+ }
980
+ /**
981
+ * This action returns a pdf document of the invoice.
982
+ *
983
+ * @param {number} id
984
+ * @param {0 | 1} [logopaper] Whether the PDF should be generated using the letterhead, or not.
985
+ * @returns {Promise<BaseStatic.PdfResponse>}
986
+ * @memberof Invoices
987
+ */
988
+ async showPdf(id, logopaper) {
989
+ const response = await this.request(
990
+ "GET",
991
+ `${this.apiEndpoint}/${id}/pdf`,
992
+ logopaper !== void 0 ? { logopaper } : void 0
993
+ );
994
+ return {
995
+ ...response,
996
+ content: Buffer.from(response.content, "base64")
997
+ };
998
+ }
999
+ /**
1000
+ * Issue an invoice. The invoice must be in the draft status.
1001
+ *
1002
+ * @param {number} id
1003
+ * @returns {Promise<InvoicesStatic.InvoiceIssued>}
1004
+ * @memberof Invoices
1005
+ */
1006
+ async issue(id) {
1007
+ return this.request(
1008
+ "POST",
1009
+ `${this.apiEndpoint}/${id}/issue`
1010
+ );
1011
+ }
1012
+ /**
1013
+ * Mark an invoice as sent.
1014
+ *
1015
+ * @param {number} id
1016
+ * @returns {Promise<InvoicesStatic.InvoiceSentAnswer>}
1017
+ * @memberof Invoices
1018
+ */
1019
+ async markAsSent(id) {
1020
+ return this.request(
1021
+ "POST",
1022
+ `${this.apiEndpoint}/${id}/mark_as_sent`
1023
+ );
1024
+ }
1025
+ /**
1026
+ * revert a Invoice issue
1027
+ *
1028
+ * @param {number} id
1029
+ * @returns {Promise<{ success: boolean }>}
1030
+ * @memberof Invoices
1031
+ */
1032
+ async revertIssue(id) {
1033
+ return this.request(
1034
+ "POST",
1035
+ `${this.apiEndpoint}/${id.toString()}/revert_issue`
1036
+ );
1037
+ }
1038
+ /**
1039
+ * Create a payment for an invoice
1040
+ *
1041
+ * @param {number} invoiceId
1042
+ * @param {Date} date
1043
+ * @param {string} value
1044
+ * @param {number} [bank_account_id]
1045
+ * @param {number} [payment_service_id]
1046
+ * @return {*} {Promise<InvoicesStatic.Payment>}
1047
+ * @memberof Invoices
1048
+ */
1049
+ async createPayment(invoiceId, date, value, bank_account_id, payment_service_id) {
1050
+ return this.request(
1051
+ "POST",
1052
+ `${this.apiEndpoint}/${invoiceId.toString()}/payment`,
1053
+ void 0,
1054
+ {
1055
+ date: `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`,
1056
+ value,
1057
+ bank_account_id,
1058
+ payment_service_id
1059
+ }
1060
+ );
1061
+ }
1062
+ /**
1063
+ * Get a payment for an invoice
1064
+ *
1065
+ * @param {number} invoiceId
1066
+ * @param {number} paymentId
1067
+ * @return {*} {Promise<InvoicesStatic.Payment>}
1068
+ * @memberof Invoices
1069
+ */
1070
+ async getPayment(invoiceId, paymentId) {
1071
+ return this.request(
1072
+ "GET",
1073
+ `${this.apiEndpoint}/${invoiceId.toString()}/payment/${paymentId.toString()}`
1074
+ );
1075
+ }
1076
+ /**
1077
+ * Delete a payment for an invoice
1078
+ *
1079
+ * @param {number} invoiceId
1080
+ * @param {number} paymentId
1081
+ * @return {*} {Promise<void>}
1082
+ * @memberof Invoices
1083
+ */
1084
+ async deletePayment(invoiceId, paymentId) {
1085
+ return this.request(
1086
+ "DELETE",
1087
+ `${this.apiEndpoint}/${invoiceId.toString()}/payment/${paymentId.toString()}`
1088
+ );
1089
+ }
1090
+ /**
1091
+ * Create a default position for an invoice
1092
+ *
1093
+ * @param {number} invoiceId
1094
+ * @param {PositionsStatic.DefaultPositionCreate} position
1095
+ * @returns {Promise<PositionsStatic.DefaultPosition>}
1096
+ * @memberof Invoices
1097
+ */
1098
+ async createDefaultPosition(invoiceId, position) {
1099
+ return new DefaultPositions(this.apiToken, "kb_invoice", invoiceId).create(
1100
+ position
1101
+ );
1102
+ }
1103
+ /**
1104
+ * Create an item position for an invoice
1105
+ *
1106
+ * @param {number} invoiceId
1107
+ * @param {PositionsStatic.ItemPositionCreate} position
1108
+ * @returns {Promise<PositionsStatic.ItemPosition>}
1109
+ * @memberof Invoices
1110
+ */
1111
+ async createItemPosition(invoiceId, position) {
1112
+ return new ItemPositions(this.apiToken, "kb_invoice", invoiceId).create(
1113
+ position
1114
+ );
1115
+ }
1116
+ /**
1117
+ * Create a text position for an invoice
1118
+ *
1119
+ * @param {number} invoiceId
1120
+ * @param {PositionsStatic.TextPositionCreate} position
1121
+ * @returns {Promise<PositionsStatic.TextPosition>}
1122
+ * @memberof Invoices
1123
+ */
1124
+ async createTextPosition(invoiceId, position) {
1125
+ return new TextPositions(this.apiToken, "kb_invoice", invoiceId).create(
1126
+ position
1127
+ );
1128
+ }
1129
+ /**
1130
+ * Delete a default position for an invoice
1131
+ *
1132
+ * @param {number} invoiceId
1133
+ * @param {number} positionId
1134
+ * @returns {Promise<boolean>}
1135
+ * @memberof Invoices
1136
+ */
1137
+ async deleteDefaultPosition(invoiceId, positionId) {
1138
+ return new DefaultPositions(this.apiToken, "kb_invoice", invoiceId).delete(
1139
+ positionId
1140
+ );
1141
+ }
1142
+ /**
1143
+ * Delete an item position for an invoice
1144
+ *
1145
+ * @param {number} invoiceId
1146
+ * @param {number} positionId
1147
+ * @returns {Promise<boolean>}
1148
+ * @memberof Invoices
1149
+ */
1150
+ async deleteItemPosition(invoiceId, positionId) {
1151
+ return new ItemPositions(this.apiToken, "kb_invoice", invoiceId).delete(
1152
+ positionId
1153
+ );
1154
+ }
1155
+ /**
1156
+ * Delete a text position for an invoice
1157
+ *
1158
+ * @param {number} invoiceId
1159
+ * @param {number} positionId
1160
+ * @returns {Promise<boolean>}
1161
+ * @memberof Invoices
1162
+ */
1163
+ async deleteTextPosition(invoiceId, positionId) {
1164
+ return new TextPositions(this.apiToken, "kb_invoice", invoiceId).delete(
1165
+ positionId
1166
+ );
1167
+ }
1168
+ /**
1169
+ * Delete a position for an invoice, whatever its type
1170
+ *
1171
+ * @param {number} invoiceId
1172
+ * @param {Pick<PositionStatic.Position, "id" | "type">} position
1173
+ * @returns {Promise<boolean>}
1174
+ * @memberof Invoices
1175
+ */
1176
+ async deletePosition(invoiceId, position) {
1177
+ return new Positions(
1178
+ this.apiToken,
1179
+ "kb_invoice",
1180
+ invoiceId,
1181
+ position.type
1182
+ ).delete(position.id);
1183
+ }
1184
+ };
1185
+
1186
+ // src/resources/Currencies.ts
1187
+ var Currencies = class extends BaseCrud {
1188
+ constructor(apiToken) {
1189
+ super(apiToken, `/3.0/currencies`);
1190
+ }
1191
+ /**
1192
+ * NOT IMPLEMENTED BY BEXIO YET
1193
+ *
1194
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
1195
+ * @param {BaseStatic.BaseOptions} [options]
1196
+ * @returns {Promise<Array<{}>>}
1197
+ * @memberof Currencies
1198
+ */
1199
+ async search(searchOptions, options) {
1200
+ throw new Error("not implemented by Bexio yet");
1201
+ }
1202
+ /**
1203
+ * NOT IMPLEMENTED BY BEXIO YET
1204
+ *
1205
+ * @param {number} id
1206
+ * @param {Overwrite} ressource
1207
+ * @returns {Promise<{}>}
1208
+ * @memberof Currencies
1209
+ */
1210
+ async overwrite(id, ressource) {
1211
+ throw new Error("not implemented by Bexio yet");
1212
+ }
1213
+ /**
1214
+ * NOT IMPLEMENTED BY BEXIO YET
1215
+ *
1216
+ * @param {number} id
1217
+ * @param {Partial<{}>} ressource
1218
+ * @returns {Promise<CurrenciesStatic.Currency>}
1219
+ * @memberof BaseCrud
1220
+ */
1221
+ async edit(id, ressource) {
1222
+ throw new Error("not implemented by Bexio yet");
1223
+ }
1224
+ };
1225
+
1226
+ // src/resources/BillsV4.ts
1227
+ var BillsV4 = class extends BaseCrud {
1228
+ constructor(apiToken) {
1229
+ super(apiToken, "/4.0/purchase/bills");
1230
+ }
1231
+ /**
1232
+ * Lists the ressource
1233
+ *
1234
+ * @param {BillsV4Static.ListOptions} [options]
1235
+ * @returns {Promise<Array<BillsV4Static.Bill>>}
1236
+ * @memberof BillsV4
1237
+ */
1238
+ async list(options) {
1239
+ const resp = await this.request("GET", this.apiEndpoint, options);
1240
+ return resp.data;
1241
+ }
1242
+ /**
1243
+ * Not implemented by Bexio yet
1244
+ *
1245
+ * @param {Array<BaseStatic.SearchParameter<BillsV4Static.SearchParameters>>} searchOptions
1246
+ * @param {BaseStatic.BaseOptions} [options]
1247
+ * @returns {Promise<BillsV4Static.Bill[]>}
1248
+ * @memberof BillsV4
1249
+ */
1250
+ async search(searchOptions, options) {
1251
+ throw new Error("not implemented by Bexio yet");
1252
+ }
1253
+ /**
1254
+ * Update bill status
1255
+ *
1256
+ * @param {string} id
1257
+ * @param {BillsV4Static.BillStatusUpdate} status
1258
+ * @returns {Promise<BillsV4Static.BillFull>}
1259
+ * @memberof BillsV4
1260
+ */
1261
+ async updateStatus(id, status) {
1262
+ return this.request(
1263
+ "PUT",
1264
+ `${this.apiEndpoint}/${id}/bookings/${status}`
1265
+ );
1266
+ }
1267
+ /**
1268
+ * Execute bill action
1269
+ *
1270
+ * @param {string} id
1271
+ * @param {BillsV4Static.BillAction} action
1272
+ * @returns {Promise<BillsV4Static.BillFull>}
1273
+ * @memberof BillsV4
1274
+ */
1275
+ async executeAction(id, action) {
1276
+ return this.request(
1277
+ "POST",
1278
+ `${this.apiEndpoint}/${id}/actions`,
1279
+ void 0,
1280
+ { action }
1281
+ );
1282
+ }
1283
+ /**
1284
+ * Validate whether document number is available or not
1285
+ *
1286
+ * @param {string} documentNo
1287
+ * @returns {Promise<{ valid: boolean; next_available_no: string }>}
1288
+ * @memberof BillsV4
1289
+ */
1290
+ async validateDocumentNumber(documentNo) {
1291
+ return this.request(
1292
+ "GET",
1293
+ "/4.0/purchase/documentnumbers/bills",
1294
+ { document_no: documentNo }
1295
+ );
1296
+ }
1297
+ };
1298
+
1299
+ // src/resources/OutgoingPayments.ts
1300
+ var OutgoingPayments = class extends BaseCrud {
1301
+ constructor(apiToken) {
1302
+ super(apiToken, "/4.0/purchase/outgoing-payments");
1303
+ }
1304
+ /**
1305
+ * search for resources - Not implemented for OutgoingPayments V4
1306
+ *
1307
+ * @memberof OutgoingPayments
1308
+ */
1309
+ async search() {
1310
+ throw new Error("Method not implemented.");
1311
+ }
1312
+ /**
1313
+ * overwrite an existing outgoing payment - Not implemented for OutgoingPayments V4
1314
+ *
1315
+ * @memberof OutgoingPayments
1316
+ */
1317
+ async overwrite(id, ressource) {
1318
+ throw new Error("Method not implemented. Use update() instead.");
1319
+ }
1320
+ /**
1321
+ * edit an existing outgoing payment - Not implemented for OutgoingPayments V4
1322
+ *
1323
+ * @memberof OutgoingPayments
1324
+ */
1325
+ async edit(id, ressource) {
1326
+ throw new Error("Method not implemented. Use update() instead.");
1327
+ }
1328
+ /**
1329
+ * delete an existing outgoing payment
1330
+ *
1331
+ * @param {T} id
1332
+ * @returns {Promise<any>}
1333
+ * @memberof OutgoingPayments
1334
+ */
1335
+ async delete(id) {
1336
+ const resp = await this.request("DELETE", `${this.apiEndpoint}/${id}`);
1337
+ if (!resp || resp && Object.keys(resp).length === 0) {
1338
+ return true;
1339
+ }
1340
+ throw new Error(`Failed to delete outgoing payment with id ${id}`);
1341
+ }
1342
+ /**
1343
+ * cancel an existing outgoing payment
1344
+ *
1345
+ * @param {string} id
1346
+ * @returns {Promise<void>}
1347
+ * @memberof OutgoingPayments
1348
+ */
1349
+ async cancel(id) {
1350
+ return this.request("POST", `${this.apiEndpoint}/${id}/cancel`);
1351
+ }
1352
+ /**
1353
+ * edit an existing outgoing payment
1354
+ *
1355
+ * @param {OutgoingPaymentsStatic.OutgoingPaymentUpdate} data
1356
+ * @returns {Promise<OutgoingPaymentsStatic.OutgoingPayment>}
1357
+ * @memberof OutgoingPayments
1358
+ */
1359
+ async update(data) {
1360
+ return this.request(
1361
+ "PUT",
1362
+ this.apiEndpoint,
1363
+ void 0,
1364
+ data
1365
+ );
1366
+ }
1367
+ /**
1368
+ * Lists the outgoing payments
1369
+ *
1370
+ * @param {OutgoingPaymentsStatic.ListOptions} options
1371
+ * @returns {Promise<OutgoingPaymentsStatic.OutgoingPayment[]>}
1372
+ * @memberof OutgoingPayments
1373
+ */
1374
+ async list(options) {
1375
+ const response = await this.request("GET", this.apiEndpoint, options);
1376
+ return response.data;
1377
+ }
1378
+ /**
1379
+ * create a new outgoing payment
1380
+ *
1381
+ * @param {OutgoingPaymentsStatic.OutgoingPaymentCreate} data
1382
+ * @returns {Promise<OutgoingPaymentsStatic.OutgoingPayment>}
1383
+ * @memberof OutgoingPayments
1384
+ */
1385
+ async create(data) {
1386
+ return this.request(
1387
+ "POST",
1388
+ this.apiEndpoint,
1389
+ void 0,
1390
+ data
1391
+ );
1392
+ }
1393
+ };
1394
+
1395
+ // src/resources/BankAccounts.ts
1396
+ var BankAccounts = class extends BaseCrud {
1397
+ constructor(apiToken) {
1398
+ super(apiToken, "/3.0/banking/accounts");
1399
+ }
1400
+ /**
1401
+ * NOT IMPLEMENTED BY BEXIO YET
1402
+ *
1403
+ * @param {Array<BaseStatic.SearchParameter<{}>>} searchOptions
1404
+ * @param {BaseStatic.BaseOptions} [options]
1405
+ * @returns {Promise<Array<{}>>}
1406
+ * @memberof BankAccounts
1407
+ */
1408
+ async search(searchOptions, options) {
1409
+ throw new Error("not implemented by Bexio yet");
1410
+ }
1411
+ /**
1412
+ * NOT IMPLEMENTED BY BEXIO YET
1413
+ *
1414
+ * @param {number} id
1415
+ * @param {{}} ressource
1416
+ * @returns {Promise<BankAccountsStatic.BankAccountFull>}
1417
+ * @memberof BankAccounts
1418
+ */
1419
+ async overwrite(id, ressource) {
1420
+ throw new Error("not implemented by Bexio yet");
1421
+ }
1422
+ /**
1423
+ * NOT IMPLEMENTED BY BEXIO YET
1424
+ *
1425
+ * @param {number} id
1426
+ * @param {Partial<{}>} ressource
1427
+ * @returns {Promise<BankAccountsStatic.BankAccountFull>}
1428
+ * @memberof BankAccounts
1429
+ */
1430
+ async edit(id, ressource) {
1431
+ throw new Error("not implemented by Bexio yet");
1432
+ }
1433
+ /**
1434
+ * NOT IMPLEMENTED BY BEXIO YET
1435
+ *
1436
+ * @param {{}} ressource
1437
+ * @returns {Promise<BankAccountsStatic.BankAccountFull>}
1438
+ * @memberof BankAccounts
1439
+ */
1440
+ async create(ressource) {
1441
+ throw new Error("not implemented by Bexio yet");
1442
+ }
1443
+ /**
1444
+ * NOT IMPLEMENTED BY BEXIO YET
1445
+ *
1446
+ * @param {number} id
1447
+ * @returns {Promise<boolean>}
1448
+ * @memberof BankAccounts
1449
+ */
1450
+ async delete(id) {
1451
+ throw new Error("not implemented by Bexio yet");
1452
+ }
1453
+ };
1454
+
1455
+ // src/resources/Accounts.ts
1456
+ var Accounts = class extends BaseCrud {
1457
+ constructor(apiToken) {
1458
+ super(apiToken, "/2.0/accounts");
1459
+ }
1460
+ /**
1461
+ * show a specific ressource
1462
+ *
1463
+ * @param {string | number} id
1464
+ * @param {BaseStatic.BaseOptions} [options]
1465
+ * @returns {Promise<AccountsStatic.Account>}
1466
+ * @memberof Accounts
1467
+ */
1468
+ async show(id, options) {
1469
+ throw new Error("not implemented by Bexio yet");
1470
+ }
1471
+ /**
1472
+ * create a new ressource
1473
+ *
1474
+ * @param {AccountsStatic.Account} ressource
1475
+ * @returns {Promise<AccountsStatic.Account>}
1476
+ * @memberof Accounts
1477
+ */
1478
+ async create(ressource) {
1479
+ throw new Error("not implemented by Bexio yet");
1480
+ }
1481
+ /**
1482
+ * overwrite an existing ressource
1483
+ *
1484
+ * @param {number} id
1485
+ * @param {AccountsStatic.Account} ressource
1486
+ * @returns {Promise<AccountsStatic.Account>}
1487
+ * @memberof Accounts
1488
+ */
1489
+ async overwrite(id, ressource) {
1490
+ throw new Error("not implemented by Bexio yet");
1491
+ }
1492
+ /**
1493
+ * edit an existing ressource
1494
+ *
1495
+ * @param {number} id
1496
+ * @param {Partial<AccountsStatic.Account>} ressource
1497
+ * @returns {Promise<AccountsStatic.Account>}
1498
+ * @memberof Accounts
1499
+ */
1500
+ async edit(id, ressource) {
1501
+ throw new Error("not implemented by Bexio yet");
1502
+ }
1503
+ /**
1504
+ * delete a ressource
1505
+ *
1506
+ * @param {number} id
1507
+ * @returns {Promise<boolean>}
1508
+ * @memberof Accounts
1509
+ */
1510
+ async delete(id) {
1511
+ throw new Error("not implemented by Bexio yet");
1512
+ }
1513
+ };
1514
+
1515
+ // src/resources/ManualEntries.ts
1516
+ var ManualEntries = class extends BaseCrud {
1517
+ constructor(apiToken) {
1518
+ super(apiToken, "/3.0/accounting/manual_entries");
1519
+ }
1520
+ /**
1521
+ * Lists the manual entries
1522
+ *
1523
+ * @param {ManualEntriesStatic.ListOptions} [options]
1524
+ * @returns {Promise<Array<ManualEntriesStatic.ManualEntry>>}
1525
+ * @memberof ManualEntries
1526
+ */
1527
+ async list(options) {
1528
+ return this.request(
1529
+ "GET",
1530
+ this.apiEndpoint,
1531
+ options
1532
+ );
1533
+ }
1534
+ /**
1535
+ * Not implemented by Bexio yet
1536
+ *
1537
+ * @param {string | number} id
1538
+ * @param {BaseStatic.BaseOptions} [options]
1539
+ * @returns {Promise<ManualEntriesStatic.ManualEntry>}
1540
+ * @memberof ManualEntries
1541
+ */
1542
+ async show(id, options) {
1543
+ throw new Error("not implemented by Bexio yet");
1544
+ }
1545
+ /**
1546
+ * Not implemented by Bexio yet
1547
+ *
1548
+ * @param {Array<BaseStatic.SearchParameter<ManualEntriesStatic.SearchParameters>>} searchOptions
1549
+ * @param {BaseStatic.BaseOptions} [options]
1550
+ * @returns {Promise<ManualEntriesStatic.ManualEntry[]>}
1551
+ * @memberof ManualEntries
1552
+ */
1553
+ async search(searchOptions, options) {
1554
+ throw new Error("not implemented by Bexio yet");
1555
+ }
1556
+ /**
1557
+ * Not implemented by Bexio yet
1558
+ *
1559
+ * @param {number} id
1560
+ * @param {Partial<ManualEntriesStatic.ManualEntryUpdate>} ressource
1561
+ * @returns {Promise<ManualEntriesStatic.ManualEntry>}
1562
+ * @memberof ManualEntries
1563
+ */
1564
+ async edit(id, ressource) {
1565
+ throw new Error("not implemented by Bexio yet");
1566
+ }
1567
+ /**
1568
+ * Get the next reference number for a manual entry
1569
+ *
1570
+ * @returns {Promise<{ next_ref_nr: string }>}
1571
+ * @memberof ManualEntries
1572
+ */
1573
+ async getNextReferenceNumber() {
1574
+ return this.request(
1575
+ "GET",
1576
+ `${this.apiEndpoint}/next_ref_nr`
1577
+ );
1578
+ }
1579
+ };
1580
+
1581
+ // src/resources/Taxes.ts
1582
+ var Taxes = class extends BaseCrud {
1583
+ constructor(accessToken) {
1584
+ super(accessToken, "/3.0/taxes");
1585
+ }
1586
+ /**
1587
+ * Lists the taxes
1588
+ *
1589
+ * @param {TaxesStatic.TaxOptions} [options]
1590
+ * @returns {Promise<TaxesStatic.Tax[]>}
1591
+ * @memberof Taxes
1592
+ */
1593
+ async list(options) {
1594
+ return super.list(options);
1595
+ }
1596
+ /**
1597
+ * Search for taxes is not implemented in the API.
1598
+ * Use list() with parameters instead.
1599
+ */
1600
+ async search() {
1601
+ throw new Error("Method not implemented.");
1602
+ }
1603
+ /**
1604
+ * Create a tax is not implemented in the API.
1605
+ */
1606
+ async create() {
1607
+ throw new Error("Method not implemented.");
1608
+ }
1609
+ /**
1610
+ * Overwrite a tax is not implemented in the API.
1611
+ */
1612
+ async overwrite() {
1613
+ throw new Error("Method not implemented.");
1614
+ }
1615
+ /**
1616
+ * Edit a tax is not implemented in the API.
1617
+ */
1618
+ async edit() {
1619
+ throw new Error("Method not implemented.");
1620
+ }
1621
+ };
1622
+
1623
+ // src/interfaces/BillsStatic.ts
1624
+ var BillsStatic;
1625
+ ((BillsStatic2) => {
1626
+ let SearchParameters;
1627
+ ((SearchParameters2) => {
1628
+ SearchParameters2["id"] = "id";
1629
+ SearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1630
+ SearchParameters2["document_nr"] = "document_nr";
1631
+ SearchParameters2["title"] = "title";
1632
+ SearchParameters2["contact_id"] = "contact_id";
1633
+ SearchParameters2["contact_sub_id"] = "contact_sub_id";
1634
+ SearchParameters2["user_id"] = "user_id";
1635
+ SearchParameters2["currency_id"] = "currency_id";
1636
+ SearchParameters2["total_gross"] = "total_gross";
1637
+ SearchParameters2["total_net"] = "total_net";
1638
+ SearchParameters2["total"] = "total";
1639
+ SearchParameters2["is_valid_from"] = "is_valid_from";
1640
+ SearchParameters2["is_valid_to"] = "is_valid_to";
1641
+ SearchParameters2["is_valid_until"] = "is_valid_until";
1642
+ SearchParameters2["updated_at"] = "updated_at";
1643
+ })(SearchParameters = BillsStatic2.SearchParameters || (BillsStatic2.SearchParameters = {}));
1644
+ })(BillsStatic || (BillsStatic = {}));
1645
+
1646
+ // src/interfaces/BusinessActivitiesStatic.ts
1647
+ var BusinessActivitiesStatic;
1648
+ ((BusinessActivitiesStatic2) => {
1649
+ let BusinessActivitySearchParameters;
1650
+ ((BusinessActivitySearchParameters2) => {
1651
+ BusinessActivitySearchParameters2["name"] = "name";
1652
+ })(BusinessActivitySearchParameters = BusinessActivitiesStatic2.BusinessActivitySearchParameters || (BusinessActivitiesStatic2.BusinessActivitySearchParameters = {}));
1653
+ })(BusinessActivitiesStatic || (BusinessActivitiesStatic = {}));
1654
+
1655
+ // src/interfaces/CalendarStatic.ts
1656
+ var CalendarStatic;
1657
+ ((CalendarStatic2) => {
1658
+ let SearchParameters;
1659
+ ((SearchParameters2) => {
1660
+ SearchParameters2["event_start"] = "event_start";
1661
+ SearchParameters2["event_end"] = "event_end";
1662
+ SearchParameters2["contact_id"] = "contact_id";
1663
+ SearchParameters2["user_id"] = "user_id";
1664
+ SearchParameters2["subject"] = "subject";
1665
+ SearchParameters2["place"] = "place";
1666
+ SearchParameters2["module_id"] = "module_id";
1667
+ SearchParameters2["entry_id"] = "entry_id";
1668
+ })(SearchParameters = CalendarStatic2.SearchParameters || (CalendarStatic2.SearchParameters = {}));
1669
+ })(CalendarStatic || (CalendarStatic = {}));
1670
+
1671
+ // src/interfaces/ContactGroupsStatic.ts
1672
+ var ContactGroupsStatic;
1673
+ ((ContactGroupsStatic2) => {
1674
+ let ContactGroupSearchParameters;
1675
+ ((ContactGroupSearchParameters2) => {
1676
+ ContactGroupSearchParameters2["name"] = "name";
1677
+ })(ContactGroupSearchParameters = ContactGroupsStatic2.ContactGroupSearchParameters || (ContactGroupsStatic2.ContactGroupSearchParameters = {}));
1678
+ })(ContactGroupsStatic || (ContactGroupsStatic = {}));
1679
+
1680
+ // src/interfaces/ContactRelationsStatic.ts
1681
+ var ContactRelationsStatic;
1682
+ ((ContactRelationsStatic2) => {
1683
+ let ContactRelationSearchParameters;
1684
+ ((ContactRelationSearchParameters2) => {
1685
+ ContactRelationSearchParameters2["contact_id"] = "contact_id";
1686
+ ContactRelationSearchParameters2["contact_sub_id"] = "contact_sub_id";
1687
+ ContactRelationSearchParameters2["updated_at"] = "updated_at";
1688
+ })(ContactRelationSearchParameters = ContactRelationsStatic2.ContactRelationSearchParameters || (ContactRelationsStatic2.ContactRelationSearchParameters = {}));
1689
+ })(ContactRelationsStatic || (ContactRelationsStatic = {}));
1690
+
1691
+ // src/interfaces/ContactSectorsStatic.ts
1692
+ var ContactSectorsStatic;
1693
+ ((ContactSectorsStatic2) => {
1694
+ let ContactSectorSearchParameters;
1695
+ ((ContactSectorSearchParameters2) => {
1696
+ ContactSectorSearchParameters2["name"] = "name";
1697
+ })(ContactSectorSearchParameters = ContactSectorsStatic2.ContactSectorSearchParameters || (ContactSectorsStatic2.ContactSectorSearchParameters = {}));
1698
+ })(ContactSectorsStatic || (ContactSectorsStatic = {}));
1699
+
1700
+ // src/interfaces/ContactTypesStatic.ts
1701
+ var ContactTypesStatic;
1702
+ ((ContactTypesStatic2) => {
1703
+ let ContactTypeSearchParameters;
1704
+ ((ContactTypeSearchParameters2) => {
1705
+ ContactTypeSearchParameters2["name"] = "name";
1706
+ })(ContactTypeSearchParameters = ContactTypesStatic2.ContactTypeSearchParameters || (ContactTypesStatic2.ContactTypeSearchParameters = {}));
1707
+ })(ContactTypesStatic || (ContactTypesStatic = {}));
1708
+
1709
+ // src/interfaces/ContactsStatic.ts
1710
+ var ContactsStatic;
1711
+ ((ContactsStatic2) => {
1712
+ let ContactSearchParameters;
1713
+ ((ContactSearchParameters2) => {
1714
+ ContactSearchParameters2["id"] = "id";
1715
+ ContactSearchParameters2["name_1"] = "name_1";
1716
+ ContactSearchParameters2["name_2"] = "name_2";
1717
+ ContactSearchParameters2["nr"] = "nr";
1718
+ ContactSearchParameters2["address"] = "address";
1719
+ ContactSearchParameters2["mail"] = "mail";
1720
+ ContactSearchParameters2["mail_second"] = "mail_second";
1721
+ ContactSearchParameters2["postcode"] = "postcode";
1722
+ ContactSearchParameters2["city"] = "city";
1723
+ ContactSearchParameters2["country_id"] = "country_id";
1724
+ ContactSearchParameters2["contact_group_ids"] = "contact_group_ids";
1725
+ ContactSearchParameters2["contact_type_id"] = "contact_type_id";
1726
+ ContactSearchParameters2["updated_at"] = "updated_at";
1727
+ ContactSearchParameters2["user_id"] = "user_id";
1728
+ ContactSearchParameters2["phone_fixed"] = "phone_fixed";
1729
+ ContactSearchParameters2["phone_mobile"] = "phone_mobile";
1730
+ ContactSearchParameters2["fax"] = "fax";
1731
+ })(ContactSearchParameters = ContactsStatic2.ContactSearchParameters || (ContactsStatic2.ContactSearchParameters = {}));
1732
+ })(ContactsStatic || (ContactsStatic = {}));
1733
+
1734
+ // src/interfaces/ExpensesStatic.ts
1735
+ var ExpensesStatic;
1736
+ ((ExpensesStatic2) => {
1737
+ let SearchParameters;
1738
+ ((SearchParameters2) => {
1739
+ SearchParameters2["id"] = "id";
1740
+ SearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1741
+ SearchParameters2["document_nr"] = "document_nr";
1742
+ SearchParameters2["title"] = "title";
1743
+ SearchParameters2["contact_id"] = "contact_id";
1744
+ SearchParameters2["contact_sub_id"] = "contact_sub_id";
1745
+ SearchParameters2["user_id"] = "user_id";
1746
+ SearchParameters2["currency_id"] = "currency_id";
1747
+ SearchParameters2["total_gross"] = "total_gross";
1748
+ SearchParameters2["total_net"] = "total_net";
1749
+ SearchParameters2["total"] = "total";
1750
+ SearchParameters2["is_valid_from"] = "is_valid_from";
1751
+ SearchParameters2["is_valid_to"] = "is_valid_to";
1752
+ SearchParameters2["is_valid_until"] = "is_valid_until";
1753
+ SearchParameters2["updated_at"] = "updated_at";
1754
+ })(SearchParameters = ExpensesStatic2.SearchParameters || (ExpensesStatic2.SearchParameters = {}));
1755
+ })(ExpensesStatic || (ExpensesStatic = {}));
1756
+
1757
+ // src/interfaces/NotesStatic.ts
1758
+ var NotesStatic;
1759
+ ((NotesStatic2) => {
1760
+ let SearchParameters;
1761
+ ((SearchParameters2) => {
1762
+ SearchParameters2["event_start"] = "event_start";
1763
+ SearchParameters2["contact_id"] = "contact_id";
1764
+ SearchParameters2["user_id"] = "user_id";
1765
+ SearchParameters2["subject"] = "subject";
1766
+ SearchParameters2["module_id"] = "module_id";
1767
+ SearchParameters2["entry_id"] = "entry_id";
1768
+ })(SearchParameters = NotesStatic2.SearchParameters || (NotesStatic2.SearchParameters = {}));
1769
+ })(NotesStatic || (NotesStatic = {}));
1770
+
1771
+ // src/interfaces/OrdersStatic.ts
1772
+ var OrdersStatic;
1773
+ ((OrdersStatic2) => {
1774
+ let OrderSearchParameters;
1775
+ ((OrderSearchParameters2) => {
1776
+ OrderSearchParameters2["id"] = "id";
1777
+ OrderSearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1778
+ OrderSearchParameters2["document_nr"] = "document_nr";
1779
+ OrderSearchParameters2["title"] = "title";
1780
+ OrderSearchParameters2["contact_id"] = "contact_id";
1781
+ OrderSearchParameters2["contact_sub_id"] = "contact_sub_id";
1782
+ OrderSearchParameters2["user_id"] = "user_id";
1783
+ OrderSearchParameters2["currency_id"] = "currency_id";
1784
+ OrderSearchParameters2["total_gross"] = "total_gross";
1785
+ OrderSearchParameters2["total_net"] = "total_net";
1786
+ OrderSearchParameters2["total"] = "total";
1787
+ OrderSearchParameters2["is_valid_from"] = "is_valid_from";
1788
+ OrderSearchParameters2["is_valid_to"] = "is_valid_to";
1789
+ OrderSearchParameters2["is_valid_until"] = "is_valid_until";
1790
+ OrderSearchParameters2["updated_at"] = "updated_at";
1791
+ })(OrderSearchParameters = OrdersStatic2.OrderSearchParameters || (OrdersStatic2.OrderSearchParameters = {}));
1792
+ })(OrdersStatic || (OrdersStatic = {}));
1793
+
1794
+ // src/interfaces/ProjectsStatic.ts
1795
+ var ProjectsStatic;
1796
+ ((ProjectsStatic2) => {
1797
+ let ProjectSearchParameters;
1798
+ ((ProjectSearchParameters2) => {
1799
+ ProjectSearchParameters2["name"] = "name";
1800
+ ProjectSearchParameters2["contact_id"] = "contact_id";
1801
+ ProjectSearchParameters2["pr_state_id"] = "pr_state_id";
1802
+ })(ProjectSearchParameters = ProjectsStatic2.ProjectSearchParameters || (ProjectsStatic2.ProjectSearchParameters = {}));
1803
+ })(ProjectsStatic || (ProjectsStatic = {}));
1804
+
1805
+ // src/interfaces/ProjectStatusesStatic.ts
1806
+ var ProjectStatusesStatic;
1807
+ ((ProjectStatusesStatic2) => {
1808
+ let ProjectStatusSearchParameters;
1809
+ ((ProjectStatusSearchParameters2) => {
1810
+ ProjectStatusSearchParameters2["text"] = "text";
1811
+ })(ProjectStatusSearchParameters = ProjectStatusesStatic2.ProjectStatusSearchParameters || (ProjectStatusesStatic2.ProjectStatusSearchParameters = {}));
1812
+ })(ProjectStatusesStatic || (ProjectStatusesStatic = {}));
1813
+
1814
+ // src/interfaces/ProjectTypesStatic.ts
1815
+ var ProjectTypesStatic;
1816
+ ((ProjectTypesStatic2) => {
1817
+ let ProjectTypeSearchParameters;
1818
+ ((ProjectTypeSearchParameters2) => {
1819
+ ProjectTypeSearchParameters2["project_type"] = "project_type";
1820
+ })(ProjectTypeSearchParameters = ProjectTypesStatic2.ProjectTypeSearchParameters || (ProjectTypesStatic2.ProjectTypeSearchParameters = {}));
1821
+ })(ProjectTypesStatic || (ProjectTypesStatic = {}));
1822
+
1823
+ // src/interfaces/SalesOrderManagementStatic.ts
1824
+ var SalesOrderManagementStatic;
1825
+ ((SalesOrderManagementStatic2) => {
1826
+ let EstimateSearchParameters;
1827
+ ((EstimateSearchParameters2) => {
1828
+ EstimateSearchParameters2["id"] = "id";
1829
+ EstimateSearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1830
+ EstimateSearchParameters2["document_nr"] = "document_nr";
1831
+ EstimateSearchParameters2["title"] = "title";
1832
+ EstimateSearchParameters2["contact_id"] = "contact_id";
1833
+ EstimateSearchParameters2["contact_sub_id"] = "contact_sub_id";
1834
+ EstimateSearchParameters2["user_id"] = "user_id";
1835
+ EstimateSearchParameters2["currency_id"] = "currency_id";
1836
+ EstimateSearchParameters2["total_gross"] = "total_gross";
1837
+ EstimateSearchParameters2["total_net"] = "total_net";
1838
+ EstimateSearchParameters2["total"] = "total";
1839
+ EstimateSearchParameters2["is_valid_from"] = "is_valid_from";
1840
+ EstimateSearchParameters2["is_valid_to"] = "is_valid_to";
1841
+ EstimateSearchParameters2["is_valid_until"] = "is_valid_until";
1842
+ EstimateSearchParameters2["updated_at"] = "updated_at";
1843
+ })(EstimateSearchParameters = SalesOrderManagementStatic2.EstimateSearchParameters || (SalesOrderManagementStatic2.EstimateSearchParameters = {}));
1844
+ let CommentSearchParameters;
1845
+ ((CommentSearchParameters2) => {
1846
+ CommentSearchParameters2["id"] = "id";
1847
+ CommentSearchParameters2["user_id"] = "user_id";
1848
+ CommentSearchParameters2["text"] = "text";
1849
+ CommentSearchParameters2["date"] = "date";
1850
+ CommentSearchParameters2["is_public"] = "is_public";
1851
+ })(CommentSearchParameters = SalesOrderManagementStatic2.CommentSearchParameters || (SalesOrderManagementStatic2.CommentSearchParameters = {}));
1852
+ let OrderSearchParameters;
1853
+ ((OrderSearchParameters2) => {
1854
+ OrderSearchParameters2["id"] = "id";
1855
+ OrderSearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1856
+ OrderSearchParameters2["document_nr"] = "document_nr";
1857
+ OrderSearchParameters2["title"] = "title";
1858
+ OrderSearchParameters2["contact_id"] = "contact_id";
1859
+ OrderSearchParameters2["contact_sub_id"] = "contact_sub_id";
1860
+ OrderSearchParameters2["user_id"] = "user_id";
1861
+ OrderSearchParameters2["currency_id"] = "currency_id";
1862
+ OrderSearchParameters2["total_gross"] = "total_gross";
1863
+ OrderSearchParameters2["total_net"] = "total_net";
1864
+ OrderSearchParameters2["total"] = "total";
1865
+ OrderSearchParameters2["is_valid_from"] = "is_valid_from";
1866
+ OrderSearchParameters2["is_valid_to"] = "is_valid_to";
1867
+ OrderSearchParameters2["is_valid_until"] = "is_valid_until";
1868
+ OrderSearchParameters2["updated_at"] = "updated_at";
1869
+ })(OrderSearchParameters = SalesOrderManagementStatic2.OrderSearchParameters || (SalesOrderManagementStatic2.OrderSearchParameters = {}));
1870
+ let InvoiceSearchParameters;
1871
+ ((InvoiceSearchParameters2) => {
1872
+ InvoiceSearchParameters2["id"] = "id";
1873
+ InvoiceSearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1874
+ InvoiceSearchParameters2["document_nr"] = "document_nr";
1875
+ InvoiceSearchParameters2["title"] = "title";
1876
+ InvoiceSearchParameters2["contact_id"] = "contact_id";
1877
+ InvoiceSearchParameters2["contact_sub_id"] = "contact_sub_id";
1878
+ InvoiceSearchParameters2["user_id"] = "user_id";
1879
+ InvoiceSearchParameters2["currency_id"] = "currency_id";
1880
+ InvoiceSearchParameters2["total_gross"] = "total_gross";
1881
+ InvoiceSearchParameters2["total_net"] = "total_net";
1882
+ InvoiceSearchParameters2["total"] = "total";
1883
+ InvoiceSearchParameters2["is_valid_from"] = "is_valid_from";
1884
+ InvoiceSearchParameters2["is_valid_to"] = "is_valid_to";
1885
+ InvoiceSearchParameters2["is_valid_until"] = "is_valid_until";
1886
+ InvoiceSearchParameters2["updated_at"] = "updated_at";
1887
+ })(InvoiceSearchParameters = SalesOrderManagementStatic2.InvoiceSearchParameters || (SalesOrderManagementStatic2.InvoiceSearchParameters = {}));
1888
+ })(SalesOrderManagementStatic || (SalesOrderManagementStatic = {}));
1889
+
1890
+ // src/interfaces/TimetrackingsStatic.ts
1891
+ var TimetrackingsStatic;
1892
+ ((TimetrackingsStatic2) => {
1893
+ let TimetrackingsSearchParameters;
1894
+ ((TimetrackingsSearchParameters2) => {
1895
+ TimetrackingsSearchParameters2["id"] = "id";
1896
+ TimetrackingsSearchParameters2["client_service_id"] = "client_service_id";
1897
+ TimetrackingsSearchParameters2["contact_id"] = "contact_id";
1898
+ TimetrackingsSearchParameters2["user_id"] = "user_id";
1899
+ TimetrackingsSearchParameters2["pr_project_id"] = "pr_project_id";
1900
+ TimetrackingsSearchParameters2["status_id"] = "status_id";
1901
+ })(TimetrackingsSearchParameters = TimetrackingsStatic2.TimetrackingsSearchParameters || (TimetrackingsStatic2.TimetrackingsSearchParameters = {}));
1902
+ })(TimetrackingsStatic || (TimetrackingsStatic = {}));
1903
+
1904
+ // src/interfaces/TimetrackingStatusesStatic.ts
1905
+ var TimetrackingStatusesStatic;
1906
+ ((TimetrackingStatusesStatic2) => {
1907
+ let TimetrackingStatusesSearchparameters;
1908
+ ((TimetrackingStatusesSearchparameters2) => {
1909
+ TimetrackingStatusesSearchparameters2["name"] = "name";
1910
+ })(TimetrackingStatusesSearchparameters = TimetrackingStatusesStatic2.TimetrackingStatusesSearchparameters || (TimetrackingStatusesStatic2.TimetrackingStatusesSearchparameters = {}));
1911
+ })(TimetrackingStatusesStatic || (TimetrackingStatusesStatic = {}));
1912
+
1913
+ // src/interfaces/UsersStatic.ts
1914
+ var UsersStatic;
1915
+ ((UsersStatic2) => {
1916
+ let UsersSearchparameters;
1917
+ ((UsersSearchparameters2) => {
1918
+ UsersSearchparameters2["id"] = "id";
1919
+ UsersSearchparameters2["nickname"] = "nickname";
1920
+ UsersSearchparameters2["firstname"] = "firstname";
1921
+ UsersSearchparameters2["lastname"] = "lastname";
1922
+ UsersSearchparameters2["color"] = "color";
1923
+ })(UsersSearchparameters = UsersStatic2.UsersSearchparameters || (UsersStatic2.UsersSearchparameters = {}));
1924
+ })(UsersStatic || (UsersStatic = {}));
1925
+
1926
+ // src/interfaces/ItemsStatic.ts
1927
+ var ItemsStatic;
1928
+ ((ItemsStatic2) => {
1929
+ let ItemSearchParameters;
1930
+ ((ItemSearchParameters2) => {
1931
+ ItemSearchParameters2["id"] = "id";
1932
+ ItemSearchParameters2["user_id"] = "user_id";
1933
+ ItemSearchParameters2["article_type_id"] = "article_type_id";
1934
+ ItemSearchParameters2["contact_id"] = "contact_id";
1935
+ ItemSearchParameters2["deliverer_code"] = "deliverer_code";
1936
+ ItemSearchParameters2["deliverer_name"] = "deliverer_name";
1937
+ ItemSearchParameters2["deliverer_description"] = "deliverer_description";
1938
+ ItemSearchParameters2["intern_code"] = "intern_code";
1939
+ ItemSearchParameters2["intern_name"] = "intern_name";
1940
+ ItemSearchParameters2["intern_description"] = "intern_description";
1941
+ ItemSearchParameters2["purchase_price"] = "purchase_price";
1942
+ ItemSearchParameters2["sale_price"] = "sale_price";
1943
+ ItemSearchParameters2["purchase_total"] = "purchase_total";
1944
+ ItemSearchParameters2["sale_total"] = "sale_total";
1945
+ ItemSearchParameters2["currency_id"] = "currency_id";
1946
+ ItemSearchParameters2["tax_income_id"] = "tax_income_id";
1947
+ ItemSearchParameters2["tax_id"] = "tax_id";
1948
+ ItemSearchParameters2["tax_expense_id"] = "tax_expense_id";
1949
+ ItemSearchParameters2["unit_id"] = "unit_id";
1950
+ ItemSearchParameters2["is_stock"] = "is_stock";
1951
+ ItemSearchParameters2["stock_id"] = "stock_id";
1952
+ ItemSearchParameters2["stock_place_id"] = "stock_place_id";
1953
+ ItemSearchParameters2["stock_nr"] = "stock_nr";
1954
+ ItemSearchParameters2["stock_min_nr"] = "stock_min_nr";
1955
+ ItemSearchParameters2["stock_reserved_nr"] = "stock_reserved_nr";
1956
+ ItemSearchParameters2["stock_available_nr"] = "stock_available_nr";
1957
+ ItemSearchParameters2["stock_picked_nr"] = "stock_picked_nr";
1958
+ ItemSearchParameters2["stock_disposed_nr"] = "stock_disposed_nr";
1959
+ ItemSearchParameters2["stock_ordered_nr"] = "stock_ordered_nr";
1960
+ ItemSearchParameters2["width"] = "width";
1961
+ ItemSearchParameters2["height"] = "height";
1962
+ ItemSearchParameters2["weight"] = "weight";
1963
+ ItemSearchParameters2["volume"] = "volume";
1964
+ ItemSearchParameters2["html_text"] = "html_text";
1965
+ ItemSearchParameters2["remarks"] = "remarks";
1966
+ ItemSearchParameters2["delivery_price"] = "delivery_price";
1967
+ ItemSearchParameters2["article_group_id"] = "article_group_id";
1968
+ })(ItemSearchParameters = ItemsStatic2.ItemSearchParameters || (ItemsStatic2.ItemSearchParameters = {}));
1969
+ })(ItemsStatic || (ItemsStatic = {}));
1970
+
1971
+ // src/interfaces/InvoicesStatic.ts
1972
+ var InvoicesStatic;
1973
+ ((InvoicesStatic2) => {
1974
+ let InvoiceSearchParameters;
1975
+ ((InvoiceSearchParameters2) => {
1976
+ InvoiceSearchParameters2["id"] = "id";
1977
+ InvoiceSearchParameters2["kb_item_status_id"] = "kb_item_status_id";
1978
+ InvoiceSearchParameters2["document_nr"] = "document_nr";
1979
+ InvoiceSearchParameters2["title"] = "title";
1980
+ InvoiceSearchParameters2["api_reference"] = "api_reference";
1981
+ InvoiceSearchParameters2["contact_id"] = "contact_id";
1982
+ InvoiceSearchParameters2["contact_sub_id"] = "contact_sub_id";
1983
+ InvoiceSearchParameters2["user_id"] = "user_id";
1984
+ InvoiceSearchParameters2["currency_id"] = "currency_id";
1985
+ InvoiceSearchParameters2["total_gross"] = "total_gross";
1986
+ InvoiceSearchParameters2["total_net"] = "total_net";
1987
+ InvoiceSearchParameters2["total"] = "total";
1988
+ InvoiceSearchParameters2["is_valid_from"] = "is_valid_from";
1989
+ InvoiceSearchParameters2["is_valid_to"] = "is_valid_to";
1990
+ InvoiceSearchParameters2["updated_at"] = "updated_at";
1991
+ })(InvoiceSearchParameters = InvoicesStatic2.InvoiceSearchParameters || (InvoicesStatic2.InvoiceSearchParameters = {}));
1992
+ let KB_ITEM_STATUS;
1993
+ ((KB_ITEM_STATUS2) => {
1994
+ KB_ITEM_STATUS2[KB_ITEM_STATUS2["Draft"] = 7] = "Draft";
1995
+ KB_ITEM_STATUS2[KB_ITEM_STATUS2["Pending"] = 8] = "Pending";
1996
+ KB_ITEM_STATUS2[KB_ITEM_STATUS2["Paid"] = 9] = "Paid";
1997
+ KB_ITEM_STATUS2[KB_ITEM_STATUS2["Partial"] = 16] = "Partial";
1998
+ KB_ITEM_STATUS2[KB_ITEM_STATUS2["Canceled"] = 19] = "Canceled";
1999
+ KB_ITEM_STATUS2[KB_ITEM_STATUS2["Unpaid"] = 31] = "Unpaid";
2000
+ })(KB_ITEM_STATUS = InvoicesStatic2.KB_ITEM_STATUS || (InvoicesStatic2.KB_ITEM_STATUS = {}));
2001
+ let MWST_TYPE;
2002
+ ((MWST_TYPE2) => {
2003
+ MWST_TYPE2[MWST_TYPE2["INCLUDING_TAXES"] = 0] = "INCLUDING_TAXES";
2004
+ MWST_TYPE2[MWST_TYPE2["EXCLUDING_TAXES"] = 1] = "EXCLUDING_TAXES";
2005
+ MWST_TYPE2[MWST_TYPE2["EXEMPT_FROM_TAXES"] = 2] = "EXEMPT_FROM_TAXES";
2006
+ })(MWST_TYPE = InvoicesStatic2.MWST_TYPE || (InvoicesStatic2.MWST_TYPE = {}));
2007
+ let PAYMENT_SERVICE;
2008
+ ((PAYMENT_SERVICE2) => {
2009
+ PAYMENT_SERVICE2[PAYMENT_SERVICE2["PAYPAL"] = 1] = "PAYPAL";
2010
+ PAYMENT_SERVICE2[PAYMENT_SERVICE2["STRIPE"] = 2] = "STRIPE";
2011
+ PAYMENT_SERVICE2[PAYMENT_SERVICE2["SIX_PAYMENTS"] = 3] = "SIX_PAYMENTS";
2012
+ })(PAYMENT_SERVICE = InvoicesStatic2.PAYMENT_SERVICE || (InvoicesStatic2.PAYMENT_SERVICE = {}));
2013
+ })(InvoicesStatic || (InvoicesStatic = {}));
2014
+
2015
+ // src/interfaces/BillsV4Static.ts
2016
+ var BillsV4Static;
2017
+ ((BillsV4Static2) => {
2018
+ let SearchParameters;
2019
+ ((SearchParameters2) => {
2020
+ SearchParameters2["document_no"] = "document_no";
2021
+ SearchParameters2["title"] = "title";
2022
+ SearchParameters2["vendor_ref"] = "vendor_ref";
2023
+ SearchParameters2["currency_code"] = "currency_code";
2024
+ SearchParameters2["lastname_company"] = "lastname_company";
2025
+ SearchParameters2["firstname_suffix"] = "firstname_suffix";
2026
+ })(SearchParameters = BillsV4Static2.SearchParameters || (BillsV4Static2.SearchParameters = {}));
2027
+ let BillStatusUpdate;
2028
+ ((BillStatusUpdate2) => {
2029
+ BillStatusUpdate2["DRAFT"] = "DRAFT";
2030
+ BillStatusUpdate2["BOOKED"] = "BOOKED";
2031
+ })(BillStatusUpdate = BillsV4Static2.BillStatusUpdate || (BillsV4Static2.BillStatusUpdate = {}));
2032
+ let BillAction;
2033
+ ((BillAction2) => {
2034
+ BillAction2["DUPLICATE"] = "DUPLICATE";
2035
+ })(BillAction = BillsV4Static2.BillAction || (BillsV4Static2.BillAction = {}));
2036
+ let BillStatusFilter;
2037
+ ((BillStatusFilter2) => {
2038
+ BillStatusFilter2["DRAFTS"] = "DRAFTS";
2039
+ BillStatusFilter2["TODO"] = "TODO";
2040
+ BillStatusFilter2["PAID"] = "PAID";
2041
+ BillStatusFilter2["OVERDUE"] = "OVERDUE";
2042
+ })(BillStatusFilter = BillsV4Static2.BillStatusFilter || (BillsV4Static2.BillStatusFilter = {}));
2043
+ let PaymentType;
2044
+ ((PaymentType2) => {
2045
+ PaymentType2["IBAN"] = "IBAN";
2046
+ PaymentType2["MANUAL"] = "MANUAL";
2047
+ PaymentType2["QR"] = "QR";
2048
+ })(PaymentType = BillsV4Static2.PaymentType || (BillsV4Static2.PaymentType = {}));
2049
+ let PaymentFee;
2050
+ ((PaymentFee2) => {
2051
+ PaymentFee2["BY_SENDER"] = "BY_SENDER";
2052
+ PaymentFee2["BY_RECEIVER"] = "BY_RECEIVER";
2053
+ PaymentFee2["BREAKDOWN"] = "BREAKDOWN";
2054
+ PaymentFee2["NO_FEE"] = "NO_FEE";
2055
+ })(PaymentFee = BillsV4Static2.PaymentFee || (BillsV4Static2.PaymentFee = {}));
2056
+ let BillStatus;
2057
+ ((BillStatus2) => {
2058
+ BillStatus2["DRAFT"] = "DRAFT";
2059
+ BillStatus2["BOOKED"] = "BOOKED";
2060
+ BillStatus2["PARTIALLY_CREATED"] = "PARTIALLY_CREATED";
2061
+ BillStatus2["CREATED"] = "CREATED";
2062
+ BillStatus2["PARTIALLY_SENT"] = "PARTIALLY_SENT";
2063
+ BillStatus2["SENT"] = "SENT";
2064
+ BillStatus2["PARTIALLY_DOWNLOADED"] = "PARTIALLY_DOWNLOADED";
2065
+ BillStatus2["DOWNLOADED"] = "DOWNLOADED";
2066
+ BillStatus2["PARTIALLY_PAID"] = "PARTIALLY_PAID";
2067
+ BillStatus2["PAID"] = "PAID";
2068
+ BillStatus2["PARTIALLY_FAILED"] = "PARTIALLY_FAILED";
2069
+ BillStatus2["FAILED"] = "FAILED";
2070
+ })(BillStatus = BillsV4Static2.BillStatus || (BillsV4Static2.BillStatus = {}));
2071
+ })(BillsV4Static || (BillsV4Static = {}));
2072
+
2073
+ // src/interfaces/OutgoingPaymentsStatic.ts
2074
+ var OutgoingPaymentsStatic;
2075
+ ((OutgoingPaymentsStatic2) => {
2076
+ let OutgoingPaymentStatus;
2077
+ ((OutgoingPaymentStatus2) => {
2078
+ OutgoingPaymentStatus2["DOWNLOADED"] = "DOWNLOADED";
2079
+ OutgoingPaymentStatus2["OPEN"] = "OPEN";
2080
+ OutgoingPaymentStatus2["RECONCILED"] = "RECONCILED";
2081
+ OutgoingPaymentStatus2["CANCELLED"] = "CANCELLED";
2082
+ OutgoingPaymentStatus2["UPLOADED"] = "UPLOADED";
2083
+ OutgoingPaymentStatus2["REJECTED"] = "REJECTED";
2084
+ })(OutgoingPaymentStatus = OutgoingPaymentsStatic2.OutgoingPaymentStatus || (OutgoingPaymentsStatic2.OutgoingPaymentStatus = {}));
2085
+ let OutgoingPaymentType;
2086
+ ((OutgoingPaymentType2) => {
2087
+ OutgoingPaymentType2["IBAN"] = "IBAN";
2088
+ OutgoingPaymentType2["MANUAL"] = "MANUAL";
2089
+ OutgoingPaymentType2["CASH_DISCOUNT"] = "CASH_DISCOUNT";
2090
+ OutgoingPaymentType2["QR"] = "QR";
2091
+ })(OutgoingPaymentType = OutgoingPaymentsStatic2.OutgoingPaymentType || (OutgoingPaymentsStatic2.OutgoingPaymentType = {}));
2092
+ let FeeType;
2093
+ ((FeeType2) => {
2094
+ FeeType2["BY_SENDER"] = "BY_SENDER";
2095
+ FeeType2["BY_RECEIVER"] = "BY_RECEIVER";
2096
+ FeeType2["BREAKDOWN"] = "BREAKDOWN";
2097
+ FeeType2["NO_FEE"] = "NO_FEE";
2098
+ })(FeeType = OutgoingPaymentsStatic2.FeeType || (OutgoingPaymentsStatic2.FeeType = {}));
2099
+ })(OutgoingPaymentsStatic || (OutgoingPaymentsStatic = {}));
2100
+
2101
+ // src/index.ts
2102
+ var Bexio = class {
2103
+ constructor(token) {
2104
+ this.token = token;
2105
+ this.businessActivities = new ClientServices(this.token);
2106
+ this.contacts = new Contacts(this.token);
2107
+ this.contactTypes = new ContactTypes(this.token);
2108
+ this.contactSectors = new ContactSectors(this.token);
2109
+ this.contactGroups = new ContactGroups(this.token);
2110
+ this.contactRelations = new ContactRelations(this.token);
2111
+ this.orders = new Orders(this.token);
2112
+ this.projects = new Projects(this.token);
2113
+ this.projectStatuses = new ProjectStatuses(this.token);
2114
+ this.projectTypes = new ProjectTypes(this.token);
2115
+ this.expenses = new Expenses(this.token);
2116
+ this.billsV4 = new BillsV4(this.token);
2117
+ this.outgoingPayments = new OutgoingPayments(this.token);
2118
+ this.bills = new Bills(this.token);
2119
+ this.timetrackings = new Timetrackings(this.token);
2120
+ this.timetrackingStatuses = new TimetrackingStatuses(this.token);
2121
+ this.users = new Users(this.token);
2122
+ this.items = new Items(this.token);
2123
+ this.invoices = new Invoices(this.token);
2124
+ this.currencies = new Currencies(this.token);
2125
+ this.bankAccounts = new BankAccounts(this.token);
2126
+ this.accounts = new Accounts(this.token);
2127
+ this.manualEntries = new ManualEntries(this.token);
2128
+ this.taxes = new Taxes(this.token);
2129
+ }
2130
+ };
2131
+ var index_default = Bexio;
2132
+ export {
2133
+ Bexio,
2134
+ BillsStatic,
2135
+ BillsV4Static,
2136
+ BusinessActivitiesStatic,
2137
+ CalendarStatic,
2138
+ ContactGroupsStatic,
2139
+ ContactRelationsStatic,
2140
+ ContactSectorsStatic,
2141
+ ContactTypesStatic,
2142
+ ContactsStatic,
2143
+ ExpensesStatic,
2144
+ InvoicesStatic,
2145
+ ItemsStatic,
2146
+ NotesStatic,
2147
+ OrdersStatic,
2148
+ OutgoingPaymentsStatic,
2149
+ ProjectStatusesStatic,
2150
+ ProjectTypesStatic,
2151
+ ProjectsStatic,
2152
+ SalesOrderManagementStatic,
2153
+ TimetrackingStatusesStatic,
2154
+ TimetrackingsStatic,
2155
+ UsersStatic,
2156
+ index_default as default
2157
+ };
2158
+ //# sourceMappingURL=index.mjs.map