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