ynab 1.55.0 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/README.md +31 -38
  2. package/dist/apis/AccountsApi.d.ts +60 -0
  3. package/dist/apis/AccountsApi.js +137 -0
  4. package/dist/apis/BudgetsApi.d.ts +58 -0
  5. package/dist/apis/BudgetsApi.js +129 -0
  6. package/dist/apis/CategoriesApi.d.ts +77 -0
  7. package/dist/apis/CategoriesApi.js +183 -0
  8. package/dist/{esm/transactionsApi.d.ts → apis/CustomTransactionsApi.d.ts} +19 -19
  9. package/dist/{transactionsApi.js → apis/CustomTransactionsApi.js} +24 -19
  10. package/dist/apis/DeprecatedApi.d.ts +32 -0
  11. package/dist/apis/DeprecatedApi.js +63 -0
  12. package/dist/apis/MonthsApi.d.ts +46 -0
  13. package/dist/apis/MonthsApi.js +98 -0
  14. package/dist/apis/PayeeLocationsApi.d.ts +59 -0
  15. package/dist/apis/PayeeLocationsApi.js +132 -0
  16. package/dist/apis/PayeesApi.d.ts +46 -0
  17. package/dist/apis/PayeesApi.js +98 -0
  18. package/dist/apis/ScheduledTransactionsApi.d.ts +46 -0
  19. package/dist/apis/ScheduledTransactionsApi.js +98 -0
  20. package/dist/apis/TransactionsApi.d.ts +201 -0
  21. package/dist/apis/TransactionsApi.js +461 -0
  22. package/dist/apis/UserApi.d.ts +28 -0
  23. package/dist/apis/UserApi.js +55 -0
  24. package/dist/apis/index.d.ts +10 -0
  25. package/dist/apis/index.js +24 -0
  26. package/dist/browser/ynab.js +1 -1
  27. package/dist/esm/apis/AccountsApi.d.ts +60 -0
  28. package/dist/esm/apis/AccountsApi.js +256 -0
  29. package/dist/esm/apis/BudgetsApi.d.ts +58 -0
  30. package/dist/esm/apis/BudgetsApi.js +248 -0
  31. package/dist/esm/apis/CategoriesApi.d.ts +77 -0
  32. package/dist/esm/apis/CategoriesApi.js +324 -0
  33. package/dist/{transactionsApi.d.ts → esm/apis/CustomTransactionsApi.d.ts} +19 -19
  34. package/dist/esm/{transactionsApi.js → apis/CustomTransactionsApi.js} +27 -22
  35. package/dist/esm/apis/DeprecatedApi.d.ts +32 -0
  36. package/dist/esm/apis/DeprecatedApi.js +138 -0
  37. package/dist/esm/apis/MonthsApi.d.ts +46 -0
  38. package/dist/esm/apis/MonthsApi.js +195 -0
  39. package/dist/esm/apis/PayeeLocationsApi.d.ts +59 -0
  40. package/dist/esm/apis/PayeeLocationsApi.js +251 -0
  41. package/dist/esm/apis/PayeesApi.d.ts +46 -0
  42. package/dist/esm/apis/PayeesApi.js +195 -0
  43. package/dist/esm/apis/ScheduledTransactionsApi.d.ts +46 -0
  44. package/dist/esm/apis/ScheduledTransactionsApi.js +195 -0
  45. package/dist/esm/apis/TransactionsApi.d.ts +201 -0
  46. package/dist/esm/apis/TransactionsApi.js +734 -0
  47. package/dist/esm/apis/UserApi.d.ts +28 -0
  48. package/dist/esm/apis/UserApi.js +130 -0
  49. package/dist/esm/apis/index.d.ts +10 -0
  50. package/dist/esm/apis/index.js +12 -0
  51. package/dist/esm/index.d.ts +24 -36
  52. package/dist/esm/index.js +22 -30
  53. package/dist/esm/models/Account.d.ts +140 -0
  54. package/dist/esm/models/Account.js +88 -0
  55. package/dist/esm/models/AccountResponse.d.ts +32 -0
  56. package/dist/esm/models/AccountResponse.js +44 -0
  57. package/dist/esm/models/AccountResponseData.d.ts +32 -0
  58. package/dist/esm/models/AccountResponseData.js +44 -0
  59. package/dist/esm/models/AccountType.d.ts +34 -0
  60. package/dist/esm/models/AccountType.js +41 -0
  61. package/dist/esm/models/AccountsResponse.d.ts +32 -0
  62. package/dist/esm/models/AccountsResponse.js +44 -0
  63. package/dist/esm/models/AccountsResponseData.d.ts +38 -0
  64. package/dist/esm/models/AccountsResponseData.js +47 -0
  65. package/dist/esm/models/BudgetDetail.d.ts +139 -0
  66. package/dist/esm/models/BudgetDetail.js +89 -0
  67. package/dist/esm/models/BudgetDetailAllOf.d.ts +95 -0
  68. package/dist/esm/models/BudgetDetailAllOf.js +71 -0
  69. package/dist/esm/models/BudgetDetailResponse.d.ts +32 -0
  70. package/dist/esm/models/BudgetDetailResponse.js +44 -0
  71. package/dist/esm/models/BudgetDetailResponseData.d.ts +38 -0
  72. package/dist/esm/models/BudgetDetailResponseData.js +47 -0
  73. package/dist/esm/models/BudgetSettings.d.ts +39 -0
  74. package/dist/esm/models/BudgetSettings.js +48 -0
  75. package/dist/esm/models/BudgetSettingsResponse.d.ts +32 -0
  76. package/dist/esm/models/BudgetSettingsResponse.js +44 -0
  77. package/dist/esm/models/BudgetSettingsResponseData.d.ts +32 -0
  78. package/dist/esm/models/BudgetSettingsResponseData.js +44 -0
  79. package/dist/esm/models/BudgetSummary.d.ts +76 -0
  80. package/dist/esm/models/BudgetSummary.js +62 -0
  81. package/dist/esm/models/BudgetSummaryResponse.d.ts +32 -0
  82. package/dist/esm/models/BudgetSummaryResponse.js +44 -0
  83. package/dist/esm/models/BudgetSummaryResponseData.d.ts +38 -0
  84. package/dist/esm/models/BudgetSummaryResponseData.js +47 -0
  85. package/dist/esm/models/BulkResponse.d.ts +32 -0
  86. package/dist/esm/models/BulkResponse.js +44 -0
  87. package/dist/esm/models/BulkResponseData.d.ts +32 -0
  88. package/dist/esm/models/BulkResponseData.js +44 -0
  89. package/dist/esm/models/BulkResponseDataBulk.d.ts +37 -0
  90. package/dist/esm/models/BulkResponseDataBulk.js +46 -0
  91. package/dist/esm/models/BulkTransactions.d.ts +32 -0
  92. package/dist/esm/models/BulkTransactions.js +44 -0
  93. package/dist/esm/models/CategoriesResponse.d.ts +32 -0
  94. package/dist/esm/models/CategoriesResponse.js +44 -0
  95. package/dist/esm/models/CategoriesResponseData.d.ts +38 -0
  96. package/dist/esm/models/CategoriesResponseData.js +47 -0
  97. package/dist/esm/models/Category.d.ts +175 -0
  98. package/dist/esm/models/Category.js +106 -0
  99. package/dist/esm/models/CategoryGroup.d.ts +49 -0
  100. package/dist/esm/models/CategoryGroup.js +52 -0
  101. package/dist/esm/models/CategoryGroupWithCategories.d.ts +56 -0
  102. package/dist/esm/models/CategoryGroupWithCategories.js +56 -0
  103. package/dist/esm/models/CategoryGroupWithCategoriesAllOf.d.ts +32 -0
  104. package/dist/esm/models/CategoryGroupWithCategoriesAllOf.js +44 -0
  105. package/dist/esm/models/CategoryResponse.d.ts +32 -0
  106. package/dist/esm/models/CategoryResponse.js +44 -0
  107. package/dist/esm/models/CategoryResponseData.d.ts +32 -0
  108. package/dist/esm/models/CategoryResponseData.js +44 -0
  109. package/dist/esm/models/CurrencyFormat.d.ts +73 -0
  110. package/dist/esm/models/CurrencyFormat.js +64 -0
  111. package/dist/esm/models/DateFormat.d.ts +31 -0
  112. package/dist/esm/models/DateFormat.js +43 -0
  113. package/dist/esm/models/ErrorDetail.d.ts +43 -0
  114. package/dist/esm/models/ErrorDetail.js +49 -0
  115. package/dist/esm/models/ErrorResponse.d.ts +32 -0
  116. package/dist/esm/models/ErrorResponse.js +44 -0
  117. package/dist/esm/models/HybridTransaction.d.ts +208 -0
  118. package/dist/esm/models/HybridTransaction.js +137 -0
  119. package/dist/esm/models/HybridTransactionAllOf.d.ts +63 -0
  120. package/dist/esm/models/HybridTransactionAllOf.js +60 -0
  121. package/dist/esm/models/HybridTransactionsResponse.d.ts +32 -0
  122. package/dist/esm/models/HybridTransactionsResponse.js +44 -0
  123. package/dist/esm/models/HybridTransactionsResponseData.d.ts +38 -0
  124. package/dist/esm/models/HybridTransactionsResponseData.js +47 -0
  125. package/dist/esm/models/MonthDetail.d.ts +80 -0
  126. package/dist/esm/models/MonthDetail.js +67 -0
  127. package/dist/esm/models/MonthDetailAllOf.d.ts +32 -0
  128. package/dist/esm/models/MonthDetailAllOf.js +44 -0
  129. package/dist/esm/models/MonthDetailResponse.d.ts +32 -0
  130. package/dist/esm/models/MonthDetailResponse.js +44 -0
  131. package/dist/esm/models/MonthDetailResponseData.d.ts +32 -0
  132. package/dist/esm/models/MonthDetailResponseData.js +44 -0
  133. package/dist/esm/models/MonthSummariesResponse.d.ts +32 -0
  134. package/dist/esm/models/MonthSummariesResponse.js +44 -0
  135. package/dist/esm/models/MonthSummariesResponseData.d.ts +38 -0
  136. package/dist/esm/models/MonthSummariesResponseData.js +47 -0
  137. package/dist/esm/models/MonthSummary.d.ts +73 -0
  138. package/dist/esm/models/MonthSummary.js +63 -0
  139. package/dist/esm/models/PatchMonthCategoryWrapper.d.ts +32 -0
  140. package/dist/esm/models/PatchMonthCategoryWrapper.js +44 -0
  141. package/dist/esm/models/PatchTransactionsWrapper.d.ts +32 -0
  142. package/dist/esm/models/PatchTransactionsWrapper.js +44 -0
  143. package/dist/esm/models/Payee.d.ts +49 -0
  144. package/dist/esm/models/Payee.js +52 -0
  145. package/dist/esm/models/PayeeLocation.d.ts +55 -0
  146. package/dist/esm/models/PayeeLocation.js +55 -0
  147. package/dist/esm/models/PayeeLocationResponse.d.ts +32 -0
  148. package/dist/esm/models/PayeeLocationResponse.js +44 -0
  149. package/dist/esm/models/PayeeLocationResponseData.d.ts +32 -0
  150. package/dist/esm/models/PayeeLocationResponseData.js +44 -0
  151. package/dist/esm/models/PayeeLocationsResponse.d.ts +32 -0
  152. package/dist/esm/models/PayeeLocationsResponse.js +44 -0
  153. package/dist/esm/models/PayeeLocationsResponseData.d.ts +32 -0
  154. package/dist/esm/models/PayeeLocationsResponseData.js +44 -0
  155. package/dist/esm/models/PayeeResponse.d.ts +32 -0
  156. package/dist/esm/models/PayeeResponse.js +44 -0
  157. package/dist/esm/models/PayeeResponseData.d.ts +32 -0
  158. package/dist/esm/models/PayeeResponseData.js +44 -0
  159. package/dist/esm/models/PayeesResponse.d.ts +32 -0
  160. package/dist/esm/models/PayeesResponse.js +44 -0
  161. package/dist/esm/models/PayeesResponseData.d.ts +38 -0
  162. package/dist/esm/models/PayeesResponseData.js +47 -0
  163. package/dist/esm/models/PostAccountWrapper.d.ts +32 -0
  164. package/dist/esm/models/PostAccountWrapper.js +44 -0
  165. package/dist/esm/models/PostTransactionsWrapper.d.ts +38 -0
  166. package/dist/esm/models/PostTransactionsWrapper.js +46 -0
  167. package/dist/esm/models/PutTransactionWrapper.d.ts +32 -0
  168. package/dist/esm/models/PutTransactionWrapper.js +44 -0
  169. package/dist/esm/models/SaveAccount.d.ts +44 -0
  170. package/dist/esm/models/SaveAccount.js +50 -0
  171. package/dist/esm/models/SaveCategoryResponse.d.ts +32 -0
  172. package/dist/esm/models/SaveCategoryResponse.js +44 -0
  173. package/dist/esm/models/SaveCategoryResponseData.d.ts +38 -0
  174. package/dist/esm/models/SaveCategoryResponseData.js +47 -0
  175. package/dist/esm/models/SaveMonthCategory.d.ts +31 -0
  176. package/dist/esm/models/SaveMonthCategory.js +43 -0
  177. package/dist/esm/models/SaveSubTransaction.d.ts +55 -0
  178. package/dist/esm/models/SaveSubTransaction.js +52 -0
  179. package/dist/esm/models/SaveTransaction.d.ts +120 -0
  180. package/dist/esm/models/SaveTransaction.js +86 -0
  181. package/dist/esm/models/SaveTransactionWithId.d.ts +126 -0
  182. package/dist/esm/models/SaveTransactionWithId.js +88 -0
  183. package/dist/esm/models/SaveTransactionWithIdAllOf.d.ts +31 -0
  184. package/dist/esm/models/SaveTransactionWithIdAllOf.js +43 -0
  185. package/dist/esm/models/SaveTransactionWithOptionalFields.d.ts +120 -0
  186. package/dist/esm/models/SaveTransactionWithOptionalFields.js +86 -0
  187. package/dist/esm/models/SaveTransactionsResponse.d.ts +32 -0
  188. package/dist/esm/models/SaveTransactionsResponse.js +44 -0
  189. package/dist/esm/models/SaveTransactionsResponseData.d.ts +56 -0
  190. package/dist/esm/models/SaveTransactionsResponseData.js +54 -0
  191. package/dist/esm/models/ScheduledSubTransaction.d.ts +73 -0
  192. package/dist/esm/models/ScheduledSubTransaction.js +61 -0
  193. package/dist/esm/models/ScheduledTransactionDetail.d.ts +154 -0
  194. package/dist/esm/models/ScheduledTransactionDetail.js +113 -0
  195. package/dist/esm/models/ScheduledTransactionDetailAllOf.d.ts +50 -0
  196. package/dist/esm/models/ScheduledTransactionDetailAllOf.js +52 -0
  197. package/dist/esm/models/ScheduledTransactionResponse.d.ts +32 -0
  198. package/dist/esm/models/ScheduledTransactionResponse.js +44 -0
  199. package/dist/esm/models/ScheduledTransactionResponseData.d.ts +32 -0
  200. package/dist/esm/models/ScheduledTransactionResponseData.js +44 -0
  201. package/dist/esm/models/ScheduledTransactionSummary.d.ts +129 -0
  202. package/dist/esm/models/ScheduledTransactionSummary.js +102 -0
  203. package/dist/esm/models/ScheduledTransactionsResponse.d.ts +32 -0
  204. package/dist/esm/models/ScheduledTransactionsResponse.js +44 -0
  205. package/dist/esm/models/ScheduledTransactionsResponseData.d.ts +38 -0
  206. package/dist/esm/models/ScheduledTransactionsResponseData.js +47 -0
  207. package/dist/esm/models/SubTransaction.d.ts +91 -0
  208. package/dist/esm/models/SubTransaction.js +67 -0
  209. package/dist/esm/models/TransactionDetail.d.ts +195 -0
  210. package/dist/esm/models/TransactionDetail.js +129 -0
  211. package/dist/esm/models/TransactionDetailAllOf.d.ts +50 -0
  212. package/dist/esm/models/TransactionDetailAllOf.js +52 -0
  213. package/dist/esm/models/TransactionResponse.d.ts +32 -0
  214. package/dist/esm/models/TransactionResponse.js +44 -0
  215. package/dist/esm/models/TransactionResponseData.d.ts +32 -0
  216. package/dist/esm/models/TransactionResponseData.js +44 -0
  217. package/dist/esm/models/TransactionSummary.d.ts +170 -0
  218. package/dist/esm/models/TransactionSummary.js +118 -0
  219. package/dist/esm/models/TransactionsImportResponse.d.ts +32 -0
  220. package/dist/esm/models/TransactionsImportResponse.js +44 -0
  221. package/dist/esm/models/TransactionsImportResponseData.d.ts +31 -0
  222. package/dist/esm/models/TransactionsImportResponseData.js +43 -0
  223. package/dist/esm/models/TransactionsResponse.d.ts +32 -0
  224. package/dist/esm/models/TransactionsResponse.js +44 -0
  225. package/dist/esm/models/TransactionsResponseData.d.ts +38 -0
  226. package/dist/esm/models/TransactionsResponseData.js +47 -0
  227. package/dist/esm/models/User.d.ts +31 -0
  228. package/dist/esm/models/User.js +43 -0
  229. package/dist/esm/models/UserResponse.d.ts +32 -0
  230. package/dist/esm/models/UserResponse.js +44 -0
  231. package/dist/esm/models/UserResponseData.d.ts +32 -0
  232. package/dist/esm/models/UserResponseData.js +44 -0
  233. package/dist/esm/models/index.d.ts +90 -0
  234. package/dist/esm/models/index.js +92 -0
  235. package/dist/esm/runtime.d.ts +182 -0
  236. package/dist/esm/runtime.js +563 -0
  237. package/dist/index.d.ts +24 -36
  238. package/dist/index.js +22 -30
  239. package/dist/models/Account.d.ts +140 -0
  240. package/dist/models/Account.js +95 -0
  241. package/dist/models/AccountResponse.d.ts +32 -0
  242. package/dist/models/AccountResponse.js +51 -0
  243. package/dist/models/AccountResponseData.d.ts +32 -0
  244. package/dist/models/AccountResponseData.js +51 -0
  245. package/dist/models/AccountType.d.ts +34 -0
  246. package/dist/models/AccountType.js +47 -0
  247. package/dist/models/AccountsResponse.d.ts +32 -0
  248. package/dist/models/AccountsResponse.js +51 -0
  249. package/dist/models/AccountsResponseData.d.ts +38 -0
  250. package/dist/models/AccountsResponseData.js +54 -0
  251. package/dist/models/BudgetDetail.d.ts +139 -0
  252. package/dist/models/BudgetDetail.js +96 -0
  253. package/dist/models/BudgetDetailAllOf.d.ts +95 -0
  254. package/dist/models/BudgetDetailAllOf.js +78 -0
  255. package/dist/models/BudgetDetailResponse.d.ts +32 -0
  256. package/dist/models/BudgetDetailResponse.js +51 -0
  257. package/dist/models/BudgetDetailResponseData.d.ts +38 -0
  258. package/dist/models/BudgetDetailResponseData.js +54 -0
  259. package/dist/models/BudgetSettings.d.ts +39 -0
  260. package/dist/models/BudgetSettings.js +55 -0
  261. package/dist/models/BudgetSettingsResponse.d.ts +32 -0
  262. package/dist/models/BudgetSettingsResponse.js +51 -0
  263. package/dist/models/BudgetSettingsResponseData.d.ts +32 -0
  264. package/dist/models/BudgetSettingsResponseData.js +51 -0
  265. package/dist/models/BudgetSummary.d.ts +76 -0
  266. package/dist/models/BudgetSummary.js +69 -0
  267. package/dist/models/BudgetSummaryResponse.d.ts +32 -0
  268. package/dist/models/BudgetSummaryResponse.js +51 -0
  269. package/dist/models/BudgetSummaryResponseData.d.ts +38 -0
  270. package/dist/models/BudgetSummaryResponseData.js +54 -0
  271. package/dist/models/BulkResponse.d.ts +32 -0
  272. package/dist/models/BulkResponse.js +51 -0
  273. package/dist/models/BulkResponseData.d.ts +32 -0
  274. package/dist/models/BulkResponseData.js +51 -0
  275. package/dist/models/BulkResponseDataBulk.d.ts +37 -0
  276. package/dist/models/BulkResponseDataBulk.js +53 -0
  277. package/dist/models/BulkTransactions.d.ts +32 -0
  278. package/dist/models/BulkTransactions.js +51 -0
  279. package/dist/models/CategoriesResponse.d.ts +32 -0
  280. package/dist/models/CategoriesResponse.js +51 -0
  281. package/dist/models/CategoriesResponseData.d.ts +38 -0
  282. package/dist/models/CategoriesResponseData.js +54 -0
  283. package/dist/models/Category.d.ts +175 -0
  284. package/dist/models/Category.js +113 -0
  285. package/dist/models/CategoryGroup.d.ts +49 -0
  286. package/dist/models/CategoryGroup.js +59 -0
  287. package/dist/models/CategoryGroupWithCategories.d.ts +56 -0
  288. package/dist/models/CategoryGroupWithCategories.js +63 -0
  289. package/dist/models/CategoryGroupWithCategoriesAllOf.d.ts +32 -0
  290. package/dist/models/CategoryGroupWithCategoriesAllOf.js +51 -0
  291. package/dist/models/CategoryResponse.d.ts +32 -0
  292. package/dist/models/CategoryResponse.js +51 -0
  293. package/dist/models/CategoryResponseData.d.ts +32 -0
  294. package/dist/models/CategoryResponseData.js +51 -0
  295. package/dist/models/CurrencyFormat.d.ts +73 -0
  296. package/dist/models/CurrencyFormat.js +71 -0
  297. package/dist/models/DateFormat.d.ts +31 -0
  298. package/dist/models/DateFormat.js +50 -0
  299. package/dist/models/ErrorDetail.d.ts +43 -0
  300. package/dist/models/ErrorDetail.js +56 -0
  301. package/dist/models/ErrorResponse.d.ts +32 -0
  302. package/dist/models/ErrorResponse.js +51 -0
  303. package/dist/models/HybridTransaction.d.ts +208 -0
  304. package/dist/models/HybridTransaction.js +144 -0
  305. package/dist/models/HybridTransactionAllOf.d.ts +63 -0
  306. package/dist/models/HybridTransactionAllOf.js +67 -0
  307. package/dist/models/HybridTransactionsResponse.d.ts +32 -0
  308. package/dist/models/HybridTransactionsResponse.js +51 -0
  309. package/dist/models/HybridTransactionsResponseData.d.ts +38 -0
  310. package/dist/models/HybridTransactionsResponseData.js +54 -0
  311. package/dist/models/MonthDetail.d.ts +80 -0
  312. package/dist/models/MonthDetail.js +74 -0
  313. package/dist/models/MonthDetailAllOf.d.ts +32 -0
  314. package/dist/models/MonthDetailAllOf.js +51 -0
  315. package/dist/models/MonthDetailResponse.d.ts +32 -0
  316. package/dist/models/MonthDetailResponse.js +51 -0
  317. package/dist/models/MonthDetailResponseData.d.ts +32 -0
  318. package/dist/models/MonthDetailResponseData.js +51 -0
  319. package/dist/models/MonthSummariesResponse.d.ts +32 -0
  320. package/dist/models/MonthSummariesResponse.js +51 -0
  321. package/dist/models/MonthSummariesResponseData.d.ts +38 -0
  322. package/dist/models/MonthSummariesResponseData.js +54 -0
  323. package/dist/models/MonthSummary.d.ts +73 -0
  324. package/dist/models/MonthSummary.js +70 -0
  325. package/dist/models/PatchMonthCategoryWrapper.d.ts +32 -0
  326. package/dist/models/PatchMonthCategoryWrapper.js +51 -0
  327. package/dist/models/PatchTransactionsWrapper.d.ts +32 -0
  328. package/dist/models/PatchTransactionsWrapper.js +51 -0
  329. package/dist/models/Payee.d.ts +49 -0
  330. package/dist/models/Payee.js +59 -0
  331. package/dist/models/PayeeLocation.d.ts +55 -0
  332. package/dist/models/PayeeLocation.js +62 -0
  333. package/dist/models/PayeeLocationResponse.d.ts +32 -0
  334. package/dist/models/PayeeLocationResponse.js +51 -0
  335. package/dist/models/PayeeLocationResponseData.d.ts +32 -0
  336. package/dist/models/PayeeLocationResponseData.js +51 -0
  337. package/dist/models/PayeeLocationsResponse.d.ts +32 -0
  338. package/dist/models/PayeeLocationsResponse.js +51 -0
  339. package/dist/models/PayeeLocationsResponseData.d.ts +32 -0
  340. package/dist/models/PayeeLocationsResponseData.js +51 -0
  341. package/dist/models/PayeeResponse.d.ts +32 -0
  342. package/dist/models/PayeeResponse.js +51 -0
  343. package/dist/models/PayeeResponseData.d.ts +32 -0
  344. package/dist/models/PayeeResponseData.js +51 -0
  345. package/dist/models/PayeesResponse.d.ts +32 -0
  346. package/dist/models/PayeesResponse.js +51 -0
  347. package/dist/models/PayeesResponseData.d.ts +38 -0
  348. package/dist/models/PayeesResponseData.js +54 -0
  349. package/dist/models/PostAccountWrapper.d.ts +32 -0
  350. package/dist/models/PostAccountWrapper.js +51 -0
  351. package/dist/models/PostTransactionsWrapper.d.ts +38 -0
  352. package/dist/models/PostTransactionsWrapper.js +53 -0
  353. package/dist/models/PutTransactionWrapper.d.ts +32 -0
  354. package/dist/models/PutTransactionWrapper.js +51 -0
  355. package/dist/models/SaveAccount.d.ts +44 -0
  356. package/dist/models/SaveAccount.js +57 -0
  357. package/dist/models/SaveCategoryResponse.d.ts +32 -0
  358. package/dist/models/SaveCategoryResponse.js +51 -0
  359. package/dist/models/SaveCategoryResponseData.d.ts +38 -0
  360. package/dist/models/SaveCategoryResponseData.js +54 -0
  361. package/dist/models/SaveMonthCategory.d.ts +31 -0
  362. package/dist/models/SaveMonthCategory.js +50 -0
  363. package/dist/models/SaveSubTransaction.d.ts +55 -0
  364. package/dist/models/SaveSubTransaction.js +59 -0
  365. package/dist/models/SaveTransaction.d.ts +120 -0
  366. package/dist/models/SaveTransaction.js +93 -0
  367. package/dist/models/SaveTransactionWithId.d.ts +126 -0
  368. package/dist/models/SaveTransactionWithId.js +95 -0
  369. package/dist/models/SaveTransactionWithIdAllOf.d.ts +31 -0
  370. package/dist/models/SaveTransactionWithIdAllOf.js +50 -0
  371. package/dist/models/SaveTransactionWithOptionalFields.d.ts +120 -0
  372. package/dist/models/SaveTransactionWithOptionalFields.js +93 -0
  373. package/dist/models/SaveTransactionsResponse.d.ts +32 -0
  374. package/dist/models/SaveTransactionsResponse.js +51 -0
  375. package/dist/models/SaveTransactionsResponseData.d.ts +56 -0
  376. package/dist/models/SaveTransactionsResponseData.js +61 -0
  377. package/dist/models/ScheduledSubTransaction.d.ts +73 -0
  378. package/dist/models/ScheduledSubTransaction.js +68 -0
  379. package/dist/models/ScheduledTransactionDetail.d.ts +154 -0
  380. package/dist/models/ScheduledTransactionDetail.js +120 -0
  381. package/dist/models/ScheduledTransactionDetailAllOf.d.ts +50 -0
  382. package/dist/models/ScheduledTransactionDetailAllOf.js +59 -0
  383. package/dist/models/ScheduledTransactionResponse.d.ts +32 -0
  384. package/dist/models/ScheduledTransactionResponse.js +51 -0
  385. package/dist/models/ScheduledTransactionResponseData.d.ts +32 -0
  386. package/dist/models/ScheduledTransactionResponseData.js +51 -0
  387. package/dist/models/ScheduledTransactionSummary.d.ts +129 -0
  388. package/dist/models/ScheduledTransactionSummary.js +109 -0
  389. package/dist/models/ScheduledTransactionsResponse.d.ts +32 -0
  390. package/dist/models/ScheduledTransactionsResponse.js +51 -0
  391. package/dist/models/ScheduledTransactionsResponseData.d.ts +38 -0
  392. package/dist/models/ScheduledTransactionsResponseData.js +54 -0
  393. package/dist/models/SubTransaction.d.ts +91 -0
  394. package/dist/models/SubTransaction.js +74 -0
  395. package/dist/models/TransactionDetail.d.ts +195 -0
  396. package/dist/models/TransactionDetail.js +136 -0
  397. package/dist/models/TransactionDetailAllOf.d.ts +50 -0
  398. package/dist/models/TransactionDetailAllOf.js +59 -0
  399. package/dist/models/TransactionResponse.d.ts +32 -0
  400. package/dist/models/TransactionResponse.js +51 -0
  401. package/dist/models/TransactionResponseData.d.ts +32 -0
  402. package/dist/models/TransactionResponseData.js +51 -0
  403. package/dist/models/TransactionSummary.d.ts +170 -0
  404. package/dist/models/TransactionSummary.js +125 -0
  405. package/dist/models/TransactionsImportResponse.d.ts +32 -0
  406. package/dist/models/TransactionsImportResponse.js +51 -0
  407. package/dist/models/TransactionsImportResponseData.d.ts +31 -0
  408. package/dist/models/TransactionsImportResponseData.js +50 -0
  409. package/dist/models/TransactionsResponse.d.ts +32 -0
  410. package/dist/models/TransactionsResponse.js +51 -0
  411. package/dist/models/TransactionsResponseData.d.ts +38 -0
  412. package/dist/models/TransactionsResponseData.js +54 -0
  413. package/dist/models/User.d.ts +31 -0
  414. package/dist/models/User.js +50 -0
  415. package/dist/models/UserResponse.d.ts +32 -0
  416. package/dist/models/UserResponse.js +51 -0
  417. package/dist/models/UserResponseData.d.ts +32 -0
  418. package/dist/models/UserResponseData.js +51 -0
  419. package/dist/models/index.d.ts +90 -0
  420. package/dist/models/index.js +104 -0
  421. package/dist/runtime.d.ts +182 -0
  422. package/dist/runtime.js +344 -0
  423. package/package.json +4 -4
  424. package/dist/api.d.ts +0 -4639
  425. package/dist/api.js +0 -3757
  426. package/dist/browser/ynab.js.LICENSE.txt +0 -1
  427. package/dist/configuration.d.ts +0 -26
  428. package/dist/configuration.js +0 -22
  429. package/dist/esm/api.d.ts +0 -4639
  430. package/dist/esm/api.js +0 -4067
  431. package/dist/esm/configuration.d.ts +0 -26
  432. package/dist/esm/configuration.js +0 -20
package/dist/api.js DELETED
@@ -1,3757 +0,0 @@
1
- "use strict";
2
- // tslint:disable
3
- /**
4
- * YNAB API Endpoints
5
- * Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com
6
- *
7
- * OpenAPI spec version: 1.0.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by the swagger code generator program.
11
- * https://github.com/swagger-api/swagger-codegen.git
12
- * Do not edit the class manually.
13
- */
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.UserApiFetchParamCreator = exports.TransactionsApi = exports.TransactionsApiFactory = exports.TransactionsApiFp = exports.TransactionsApiFetchParamCreator = exports.ScheduledTransactionsApi = exports.ScheduledTransactionsApiFactory = exports.ScheduledTransactionsApiFp = exports.ScheduledTransactionsApiFetchParamCreator = exports.PayeesApi = exports.PayeesApiFactory = exports.PayeesApiFp = exports.PayeesApiFetchParamCreator = exports.PayeeLocationsApi = exports.PayeeLocationsApiFactory = exports.PayeeLocationsApiFp = exports.PayeeLocationsApiFetchParamCreator = exports.MonthsApi = exports.MonthsApiFactory = exports.MonthsApiFp = exports.MonthsApiFetchParamCreator = exports.DeprecatedApi = exports.DeprecatedApiFactory = exports.DeprecatedApiFp = exports.DeprecatedApiFetchParamCreator = exports.CategoriesApi = exports.CategoriesApiFactory = exports.CategoriesApiFp = exports.CategoriesApiFetchParamCreator = exports.BudgetsApi = exports.BudgetsApiFactory = exports.BudgetsApiFp = exports.BudgetsApiFetchParamCreator = exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiFetchParamCreator = exports.TransactionDetail = exports.ScheduledTransactionDetail = exports.SaveTransactionWithId = exports.SaveTransaction = exports.HybridTransaction = exports.TransactionSummary = exports.ScheduledTransactionSummary = exports.SaveTransactionWithOptionalFields = exports.Category = exports.AccountType = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = void 0;
25
- exports.UserApi = exports.UserApiFactory = exports.UserApiFp = void 0;
26
- // Polyfill fetch globally - this makes it easier to override with modules like fetch-mock.
27
- const fetchPonyfill = require("fetch-ponyfill")();
28
- if (!globalThis.fetch) {
29
- globalThis.fetch = fetchPonyfill.fetch;
30
- globalThis.Response = fetchPonyfill.Response;
31
- globalThis.Headers = fetchPonyfill.Headers;
32
- globalThis.Request = fetchPonyfill.Request;
33
- }
34
- const USER_AGENT = "api_client/js/1.45.0";
35
- function convertDateToFullDateStringFormat(date) {
36
- // Convert to RFC 3339 "full-date" format, like "2017-11-27"
37
- if (date instanceof Date) {
38
- return date.toISOString().substring(0, 10);
39
- }
40
- else {
41
- return date;
42
- }
43
- }
44
- /**
45
- *
46
- * @export
47
- */
48
- exports.COLLECTION_FORMATS = {
49
- csv: ",",
50
- ssv: " ",
51
- tsv: "\t",
52
- pipes: "|",
53
- };
54
- /**
55
- *
56
- * @export
57
- * @class BaseAPI
58
- */
59
- class BaseAPI {
60
- constructor(configuration) {
61
- if (configuration) {
62
- this.configuration = configuration;
63
- }
64
- }
65
- }
66
- exports.BaseAPI = BaseAPI;
67
- ;
68
- /**
69
- *
70
- * @export
71
- * @class RequiredError
72
- * @extends {Error}
73
- */
74
- class RequiredError extends Error {
75
- constructor(field, msg) {
76
- super(msg);
77
- this.field = field;
78
- }
79
- }
80
- exports.RequiredError = RequiredError;
81
- /**
82
- * The type of account
83
- * @export
84
- * @enum {string}
85
- */
86
- var AccountType;
87
- (function (AccountType) {
88
- AccountType[AccountType["Checking"] = 'checking'] = "Checking";
89
- AccountType[AccountType["Savings"] = 'savings'] = "Savings";
90
- AccountType[AccountType["Cash"] = 'cash'] = "Cash";
91
- AccountType[AccountType["CreditCard"] = 'creditCard'] = "CreditCard";
92
- AccountType[AccountType["LineOfCredit"] = 'lineOfCredit'] = "LineOfCredit";
93
- AccountType[AccountType["OtherAsset"] = 'otherAsset'] = "OtherAsset";
94
- AccountType[AccountType["OtherLiability"] = 'otherLiability'] = "OtherLiability";
95
- AccountType[AccountType["Mortgage"] = 'mortgage'] = "Mortgage";
96
- AccountType[AccountType["AutoLoan"] = 'autoLoan'] = "AutoLoan";
97
- AccountType[AccountType["StudentLoan"] = 'studentLoan'] = "StudentLoan";
98
- AccountType[AccountType["PersonalLoan"] = 'personalLoan'] = "PersonalLoan";
99
- AccountType[AccountType["MedicalDebt"] = 'medicalDebt'] = "MedicalDebt";
100
- AccountType[AccountType["OtherDebt"] = 'otherDebt'] = "OtherDebt";
101
- })(AccountType = exports.AccountType || (exports.AccountType = {}));
102
- /**
103
- * @export
104
- * @namespace Category
105
- */
106
- var Category;
107
- (function (Category) {
108
- /**
109
- * @export
110
- * @enum {string}
111
- */
112
- let GoalTypeEnum;
113
- (function (GoalTypeEnum) {
114
- GoalTypeEnum[GoalTypeEnum["TB"] = 'TB'] = "TB";
115
- GoalTypeEnum[GoalTypeEnum["TBD"] = 'TBD'] = "TBD";
116
- GoalTypeEnum[GoalTypeEnum["MF"] = 'MF'] = "MF";
117
- GoalTypeEnum[GoalTypeEnum["NEED"] = 'NEED'] = "NEED";
118
- GoalTypeEnum[GoalTypeEnum["DEBT"] = 'DEBT'] = "DEBT";
119
- })(GoalTypeEnum = Category.GoalTypeEnum || (Category.GoalTypeEnum = {}));
120
- })(Category = exports.Category || (exports.Category = {}));
121
- /**
122
- * @export
123
- * @namespace SaveTransactionWithOptionalFields
124
- */
125
- var SaveTransactionWithOptionalFields;
126
- (function (SaveTransactionWithOptionalFields) {
127
- /**
128
- * @export
129
- * @enum {string}
130
- */
131
- let ClearedEnum;
132
- (function (ClearedEnum) {
133
- ClearedEnum[ClearedEnum["Cleared"] = 'cleared'] = "Cleared";
134
- ClearedEnum[ClearedEnum["Uncleared"] = 'uncleared'] = "Uncleared";
135
- ClearedEnum[ClearedEnum["Reconciled"] = 'reconciled'] = "Reconciled";
136
- })(ClearedEnum = SaveTransactionWithOptionalFields.ClearedEnum || (SaveTransactionWithOptionalFields.ClearedEnum = {}));
137
- /**
138
- * @export
139
- * @enum {string}
140
- */
141
- let FlagColorEnum;
142
- (function (FlagColorEnum) {
143
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
144
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
145
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
146
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
147
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
148
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
149
- })(FlagColorEnum = SaveTransactionWithOptionalFields.FlagColorEnum || (SaveTransactionWithOptionalFields.FlagColorEnum = {}));
150
- })(SaveTransactionWithOptionalFields = exports.SaveTransactionWithOptionalFields || (exports.SaveTransactionWithOptionalFields = {}));
151
- /**
152
- * @export
153
- * @namespace ScheduledTransactionSummary
154
- */
155
- var ScheduledTransactionSummary;
156
- (function (ScheduledTransactionSummary) {
157
- /**
158
- * @export
159
- * @enum {string}
160
- */
161
- let FrequencyEnum;
162
- (function (FrequencyEnum) {
163
- FrequencyEnum[FrequencyEnum["Never"] = 'never'] = "Never";
164
- FrequencyEnum[FrequencyEnum["Daily"] = 'daily'] = "Daily";
165
- FrequencyEnum[FrequencyEnum["Weekly"] = 'weekly'] = "Weekly";
166
- FrequencyEnum[FrequencyEnum["EveryOtherWeek"] = 'everyOtherWeek'] = "EveryOtherWeek";
167
- FrequencyEnum[FrequencyEnum["TwiceAMonth"] = 'twiceAMonth'] = "TwiceAMonth";
168
- FrequencyEnum[FrequencyEnum["Every4Weeks"] = 'every4Weeks'] = "Every4Weeks";
169
- FrequencyEnum[FrequencyEnum["Monthly"] = 'monthly'] = "Monthly";
170
- FrequencyEnum[FrequencyEnum["EveryOtherMonth"] = 'everyOtherMonth'] = "EveryOtherMonth";
171
- FrequencyEnum[FrequencyEnum["Every3Months"] = 'every3Months'] = "Every3Months";
172
- FrequencyEnum[FrequencyEnum["Every4Months"] = 'every4Months'] = "Every4Months";
173
- FrequencyEnum[FrequencyEnum["TwiceAYear"] = 'twiceAYear'] = "TwiceAYear";
174
- FrequencyEnum[FrequencyEnum["Yearly"] = 'yearly'] = "Yearly";
175
- FrequencyEnum[FrequencyEnum["EveryOtherYear"] = 'everyOtherYear'] = "EveryOtherYear";
176
- })(FrequencyEnum = ScheduledTransactionSummary.FrequencyEnum || (ScheduledTransactionSummary.FrequencyEnum = {}));
177
- /**
178
- * @export
179
- * @enum {string}
180
- */
181
- let FlagColorEnum;
182
- (function (FlagColorEnum) {
183
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
184
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
185
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
186
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
187
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
188
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
189
- })(FlagColorEnum = ScheduledTransactionSummary.FlagColorEnum || (ScheduledTransactionSummary.FlagColorEnum = {}));
190
- })(ScheduledTransactionSummary = exports.ScheduledTransactionSummary || (exports.ScheduledTransactionSummary = {}));
191
- /**
192
- * @export
193
- * @namespace TransactionSummary
194
- */
195
- var TransactionSummary;
196
- (function (TransactionSummary) {
197
- /**
198
- * @export
199
- * @enum {string}
200
- */
201
- let ClearedEnum;
202
- (function (ClearedEnum) {
203
- ClearedEnum[ClearedEnum["Cleared"] = 'cleared'] = "Cleared";
204
- ClearedEnum[ClearedEnum["Uncleared"] = 'uncleared'] = "Uncleared";
205
- ClearedEnum[ClearedEnum["Reconciled"] = 'reconciled'] = "Reconciled";
206
- })(ClearedEnum = TransactionSummary.ClearedEnum || (TransactionSummary.ClearedEnum = {}));
207
- /**
208
- * @export
209
- * @enum {string}
210
- */
211
- let FlagColorEnum;
212
- (function (FlagColorEnum) {
213
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
214
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
215
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
216
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
217
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
218
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
219
- })(FlagColorEnum = TransactionSummary.FlagColorEnum || (TransactionSummary.FlagColorEnum = {}));
220
- /**
221
- * @export
222
- * @enum {string}
223
- */
224
- let DebtTransactionTypeEnum;
225
- (function (DebtTransactionTypeEnum) {
226
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Payment"] = 'payment'] = "Payment";
227
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Refund"] = 'refund'] = "Refund";
228
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Fee"] = 'fee'] = "Fee";
229
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Interest"] = 'interest'] = "Interest";
230
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Escrow"] = 'escrow'] = "Escrow";
231
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["BalancedAdjustment"] = 'balancedAdjustment'] = "BalancedAdjustment";
232
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Credit"] = 'credit'] = "Credit";
233
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Charge"] = 'charge'] = "Charge";
234
- })(DebtTransactionTypeEnum = TransactionSummary.DebtTransactionTypeEnum || (TransactionSummary.DebtTransactionTypeEnum = {}));
235
- })(TransactionSummary = exports.TransactionSummary || (exports.TransactionSummary = {}));
236
- /**
237
- * @export
238
- * @namespace HybridTransaction
239
- */
240
- var HybridTransaction;
241
- (function (HybridTransaction) {
242
- /**
243
- * @export
244
- * @enum {string}
245
- */
246
- let ClearedEnum;
247
- (function (ClearedEnum) {
248
- ClearedEnum[ClearedEnum["Cleared"] = 'cleared'] = "Cleared";
249
- ClearedEnum[ClearedEnum["Uncleared"] = 'uncleared'] = "Uncleared";
250
- ClearedEnum[ClearedEnum["Reconciled"] = 'reconciled'] = "Reconciled";
251
- })(ClearedEnum = HybridTransaction.ClearedEnum || (HybridTransaction.ClearedEnum = {}));
252
- /**
253
- * @export
254
- * @enum {string}
255
- */
256
- let FlagColorEnum;
257
- (function (FlagColorEnum) {
258
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
259
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
260
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
261
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
262
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
263
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
264
- })(FlagColorEnum = HybridTransaction.FlagColorEnum || (HybridTransaction.FlagColorEnum = {}));
265
- /**
266
- * @export
267
- * @enum {string}
268
- */
269
- let DebtTransactionTypeEnum;
270
- (function (DebtTransactionTypeEnum) {
271
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Payment"] = 'payment'] = "Payment";
272
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Refund"] = 'refund'] = "Refund";
273
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Fee"] = 'fee'] = "Fee";
274
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Interest"] = 'interest'] = "Interest";
275
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Escrow"] = 'escrow'] = "Escrow";
276
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["BalancedAdjustment"] = 'balancedAdjustment'] = "BalancedAdjustment";
277
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Credit"] = 'credit'] = "Credit";
278
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Charge"] = 'charge'] = "Charge";
279
- })(DebtTransactionTypeEnum = HybridTransaction.DebtTransactionTypeEnum || (HybridTransaction.DebtTransactionTypeEnum = {}));
280
- /**
281
- * @export
282
- * @enum {string}
283
- */
284
- let TypeEnum;
285
- (function (TypeEnum) {
286
- TypeEnum[TypeEnum["Transaction"] = 'transaction'] = "Transaction";
287
- TypeEnum[TypeEnum["Subtransaction"] = 'subtransaction'] = "Subtransaction";
288
- })(TypeEnum = HybridTransaction.TypeEnum || (HybridTransaction.TypeEnum = {}));
289
- })(HybridTransaction = exports.HybridTransaction || (exports.HybridTransaction = {}));
290
- /**
291
- * @export
292
- * @namespace SaveTransaction
293
- */
294
- var SaveTransaction;
295
- (function (SaveTransaction) {
296
- /**
297
- * @export
298
- * @enum {string}
299
- */
300
- let ClearedEnum;
301
- (function (ClearedEnum) {
302
- ClearedEnum[ClearedEnum["Cleared"] = 'cleared'] = "Cleared";
303
- ClearedEnum[ClearedEnum["Uncleared"] = 'uncleared'] = "Uncleared";
304
- ClearedEnum[ClearedEnum["Reconciled"] = 'reconciled'] = "Reconciled";
305
- })(ClearedEnum = SaveTransaction.ClearedEnum || (SaveTransaction.ClearedEnum = {}));
306
- /**
307
- * @export
308
- * @enum {string}
309
- */
310
- let FlagColorEnum;
311
- (function (FlagColorEnum) {
312
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
313
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
314
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
315
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
316
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
317
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
318
- })(FlagColorEnum = SaveTransaction.FlagColorEnum || (SaveTransaction.FlagColorEnum = {}));
319
- })(SaveTransaction = exports.SaveTransaction || (exports.SaveTransaction = {}));
320
- /**
321
- * @export
322
- * @namespace SaveTransactionWithId
323
- */
324
- var SaveTransactionWithId;
325
- (function (SaveTransactionWithId) {
326
- /**
327
- * @export
328
- * @enum {string}
329
- */
330
- let ClearedEnum;
331
- (function (ClearedEnum) {
332
- ClearedEnum[ClearedEnum["Cleared"] = 'cleared'] = "Cleared";
333
- ClearedEnum[ClearedEnum["Uncleared"] = 'uncleared'] = "Uncleared";
334
- ClearedEnum[ClearedEnum["Reconciled"] = 'reconciled'] = "Reconciled";
335
- })(ClearedEnum = SaveTransactionWithId.ClearedEnum || (SaveTransactionWithId.ClearedEnum = {}));
336
- /**
337
- * @export
338
- * @enum {string}
339
- */
340
- let FlagColorEnum;
341
- (function (FlagColorEnum) {
342
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
343
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
344
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
345
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
346
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
347
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
348
- })(FlagColorEnum = SaveTransactionWithId.FlagColorEnum || (SaveTransactionWithId.FlagColorEnum = {}));
349
- })(SaveTransactionWithId = exports.SaveTransactionWithId || (exports.SaveTransactionWithId = {}));
350
- /**
351
- * @export
352
- * @namespace ScheduledTransactionDetail
353
- */
354
- var ScheduledTransactionDetail;
355
- (function (ScheduledTransactionDetail) {
356
- /**
357
- * @export
358
- * @enum {string}
359
- */
360
- let FrequencyEnum;
361
- (function (FrequencyEnum) {
362
- FrequencyEnum[FrequencyEnum["Never"] = 'never'] = "Never";
363
- FrequencyEnum[FrequencyEnum["Daily"] = 'daily'] = "Daily";
364
- FrequencyEnum[FrequencyEnum["Weekly"] = 'weekly'] = "Weekly";
365
- FrequencyEnum[FrequencyEnum["EveryOtherWeek"] = 'everyOtherWeek'] = "EveryOtherWeek";
366
- FrequencyEnum[FrequencyEnum["TwiceAMonth"] = 'twiceAMonth'] = "TwiceAMonth";
367
- FrequencyEnum[FrequencyEnum["Every4Weeks"] = 'every4Weeks'] = "Every4Weeks";
368
- FrequencyEnum[FrequencyEnum["Monthly"] = 'monthly'] = "Monthly";
369
- FrequencyEnum[FrequencyEnum["EveryOtherMonth"] = 'everyOtherMonth'] = "EveryOtherMonth";
370
- FrequencyEnum[FrequencyEnum["Every3Months"] = 'every3Months'] = "Every3Months";
371
- FrequencyEnum[FrequencyEnum["Every4Months"] = 'every4Months'] = "Every4Months";
372
- FrequencyEnum[FrequencyEnum["TwiceAYear"] = 'twiceAYear'] = "TwiceAYear";
373
- FrequencyEnum[FrequencyEnum["Yearly"] = 'yearly'] = "Yearly";
374
- FrequencyEnum[FrequencyEnum["EveryOtherYear"] = 'everyOtherYear'] = "EveryOtherYear";
375
- })(FrequencyEnum = ScheduledTransactionDetail.FrequencyEnum || (ScheduledTransactionDetail.FrequencyEnum = {}));
376
- /**
377
- * @export
378
- * @enum {string}
379
- */
380
- let FlagColorEnum;
381
- (function (FlagColorEnum) {
382
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
383
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
384
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
385
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
386
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
387
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
388
- })(FlagColorEnum = ScheduledTransactionDetail.FlagColorEnum || (ScheduledTransactionDetail.FlagColorEnum = {}));
389
- })(ScheduledTransactionDetail = exports.ScheduledTransactionDetail || (exports.ScheduledTransactionDetail = {}));
390
- /**
391
- * @export
392
- * @namespace TransactionDetail
393
- */
394
- var TransactionDetail;
395
- (function (TransactionDetail) {
396
- /**
397
- * @export
398
- * @enum {string}
399
- */
400
- let ClearedEnum;
401
- (function (ClearedEnum) {
402
- ClearedEnum[ClearedEnum["Cleared"] = 'cleared'] = "Cleared";
403
- ClearedEnum[ClearedEnum["Uncleared"] = 'uncleared'] = "Uncleared";
404
- ClearedEnum[ClearedEnum["Reconciled"] = 'reconciled'] = "Reconciled";
405
- })(ClearedEnum = TransactionDetail.ClearedEnum || (TransactionDetail.ClearedEnum = {}));
406
- /**
407
- * @export
408
- * @enum {string}
409
- */
410
- let FlagColorEnum;
411
- (function (FlagColorEnum) {
412
- FlagColorEnum[FlagColorEnum["Red"] = 'red'] = "Red";
413
- FlagColorEnum[FlagColorEnum["Orange"] = 'orange'] = "Orange";
414
- FlagColorEnum[FlagColorEnum["Yellow"] = 'yellow'] = "Yellow";
415
- FlagColorEnum[FlagColorEnum["Green"] = 'green'] = "Green";
416
- FlagColorEnum[FlagColorEnum["Blue"] = 'blue'] = "Blue";
417
- FlagColorEnum[FlagColorEnum["Purple"] = 'purple'] = "Purple";
418
- })(FlagColorEnum = TransactionDetail.FlagColorEnum || (TransactionDetail.FlagColorEnum = {}));
419
- /**
420
- * @export
421
- * @enum {string}
422
- */
423
- let DebtTransactionTypeEnum;
424
- (function (DebtTransactionTypeEnum) {
425
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Payment"] = 'payment'] = "Payment";
426
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Refund"] = 'refund'] = "Refund";
427
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Fee"] = 'fee'] = "Fee";
428
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Interest"] = 'interest'] = "Interest";
429
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Escrow"] = 'escrow'] = "Escrow";
430
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["BalancedAdjustment"] = 'balancedAdjustment'] = "BalancedAdjustment";
431
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Credit"] = 'credit'] = "Credit";
432
- DebtTransactionTypeEnum[DebtTransactionTypeEnum["Charge"] = 'charge'] = "Charge";
433
- })(DebtTransactionTypeEnum = TransactionDetail.DebtTransactionTypeEnum || (TransactionDetail.DebtTransactionTypeEnum = {}));
434
- })(TransactionDetail = exports.TransactionDetail || (exports.TransactionDetail = {}));
435
- /**
436
- * AccountsApi - fetch parameter creator
437
- * @export
438
- */
439
- const AccountsApiFetchParamCreator = function (configuration) {
440
- return {
441
- /**
442
- * Creates a new account
443
- * @summary Create a new account
444
- * @param {string} budget_id - The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
445
- * @param {PostAccountWrapper} data - The account to create.
446
- * @param {*} [options] - Override http request options.
447
- * @throws {RequiredError}
448
- */
449
- createAccount(budget_id, data, options = {}) {
450
- // verify required parameter 'budget_id' is not null or undefined
451
- if (budget_id === null || budget_id === undefined) {
452
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling createAccount.');
453
- }
454
- // verify required parameter 'data' is not null or undefined
455
- if (data === null || data === undefined) {
456
- throw new RequiredError('data', 'Required parameter data was null or undefined when calling createAccount.');
457
- }
458
- const localVarPath = `/budgets/{budget_id}/accounts`
459
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
460
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
461
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
462
- const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
463
- const localVarHeaderParameter = {};
464
- const localVarQueryParameter = {};
465
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
466
- localVarHeaderParameter["Accept"] = "application/json";
467
- // authentication bearer required
468
- if (configuration && configuration.apiKey) {
469
- const localVarApiKeyValue = configuration.apiKey;
470
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
471
- }
472
- localVarHeaderParameter['Content-Type'] = 'application/json';
473
- const query = new URLSearchParams(localVarUrlObj.search);
474
- for (const key in localVarQueryParameter) {
475
- query.set(key, localVarQueryParameter[key]);
476
- }
477
- for (const key in options.query) {
478
- query.set(key, options.query[key]);
479
- }
480
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
481
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
482
- localVarRequestOptions.body = JSON.stringify(data || {});
483
- return {
484
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
485
- options: localVarRequestOptions,
486
- };
487
- },
488
- /**
489
- * Returns a single account
490
- * @summary Single account
491
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
492
- * @param {string} account_id - The id of the account
493
- * @param {*} [options] - Override http request options.
494
- * @throws {RequiredError}
495
- */
496
- getAccountById(budget_id, account_id, options = {}) {
497
- // verify required parameter 'budget_id' is not null or undefined
498
- if (budget_id === null || budget_id === undefined) {
499
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getAccountById.');
500
- }
501
- // verify required parameter 'account_id' is not null or undefined
502
- if (account_id === null || account_id === undefined) {
503
- throw new RequiredError('account_id', 'Required parameter account_id was null or undefined when calling getAccountById.');
504
- }
505
- const localVarPath = `/budgets/{budget_id}/accounts/{account_id}`
506
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
507
- .replace(`{${"account_id"}}`, encodeURIComponent(String(account_id)));
508
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
509
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
510
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
511
- const localVarHeaderParameter = {};
512
- const localVarQueryParameter = {};
513
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
514
- localVarHeaderParameter["Accept"] = "application/json";
515
- // authentication bearer required
516
- if (configuration && configuration.apiKey) {
517
- const localVarApiKeyValue = configuration.apiKey;
518
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
519
- }
520
- const query = new URLSearchParams(localVarUrlObj.search);
521
- for (const key in localVarQueryParameter) {
522
- query.set(key, localVarQueryParameter[key]);
523
- }
524
- for (const key in options.query) {
525
- query.set(key, options.query[key]);
526
- }
527
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
528
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
529
- return {
530
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
531
- options: localVarRequestOptions,
532
- };
533
- },
534
- /**
535
- * Returns all accounts
536
- * @summary Account list
537
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
538
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
539
- * @param {*} [options] - Override http request options.
540
- * @throws {RequiredError}
541
- */
542
- getAccounts(budget_id, last_knowledge_of_server, options = {}) {
543
- // verify required parameter 'budget_id' is not null or undefined
544
- if (budget_id === null || budget_id === undefined) {
545
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getAccounts.');
546
- }
547
- const localVarPath = `/budgets/{budget_id}/accounts`
548
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
549
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
550
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
551
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
552
- const localVarHeaderParameter = {};
553
- const localVarQueryParameter = {};
554
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
555
- localVarHeaderParameter["Accept"] = "application/json";
556
- // authentication bearer required
557
- if (configuration && configuration.apiKey) {
558
- const localVarApiKeyValue = configuration.apiKey;
559
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
560
- }
561
- if (last_knowledge_of_server !== undefined) {
562
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
563
- }
564
- const query = new URLSearchParams(localVarUrlObj.search);
565
- for (const key in localVarQueryParameter) {
566
- query.set(key, localVarQueryParameter[key]);
567
- }
568
- for (const key in options.query) {
569
- query.set(key, options.query[key]);
570
- }
571
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
572
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
573
- return {
574
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
575
- options: localVarRequestOptions,
576
- };
577
- },
578
- };
579
- };
580
- exports.AccountsApiFetchParamCreator = AccountsApiFetchParamCreator;
581
- /**
582
- * AccountsApi - functional programming interface
583
- * @export
584
- */
585
- const AccountsApiFp = function (configuration) {
586
- return {
587
- /**
588
- * Creates a new account
589
- * @summary Create a new account
590
- * @param {string} budget_id - The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
591
- * @param {PostAccountWrapper} data - The account to create.
592
- * @param {*} [options] - Override http request options.
593
- * @throws {RequiredError}
594
- */
595
- createAccount(budget_id, data, options) {
596
- const localVarFetchArgs = (0, exports.AccountsApiFetchParamCreator)(configuration).createAccount(budget_id, data, options);
597
- return (fetchFunction = fetch) => {
598
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
599
- if (response.status >= 200 && response.status < 300) {
600
- const apiResponse = yield response.json();
601
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
602
- return apiResponse;
603
- }
604
- else {
605
- return response.json().then((e) => {
606
- return Promise.reject(e);
607
- });
608
- }
609
- }));
610
- };
611
- },
612
- /**
613
- * Returns a single account
614
- * @summary Single account
615
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
616
- * @param {string} account_id - The id of the account
617
- * @param {*} [options] - Override http request options.
618
- * @throws {RequiredError}
619
- */
620
- getAccountById(budget_id, account_id, options) {
621
- const localVarFetchArgs = (0, exports.AccountsApiFetchParamCreator)(configuration).getAccountById(budget_id, account_id, options);
622
- return (fetchFunction = fetch) => {
623
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
624
- if (response.status >= 200 && response.status < 300) {
625
- const apiResponse = yield response.json();
626
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
627
- return apiResponse;
628
- }
629
- else {
630
- return response.json().then((e) => {
631
- return Promise.reject(e);
632
- });
633
- }
634
- }));
635
- };
636
- },
637
- /**
638
- * Returns all accounts
639
- * @summary Account list
640
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
641
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
642
- * @param {*} [options] - Override http request options.
643
- * @throws {RequiredError}
644
- */
645
- getAccounts(budget_id, last_knowledge_of_server, options) {
646
- const localVarFetchArgs = (0, exports.AccountsApiFetchParamCreator)(configuration).getAccounts(budget_id, last_knowledge_of_server, options);
647
- return (fetchFunction = fetch) => {
648
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
649
- if (response.status >= 200 && response.status < 300) {
650
- const apiResponse = yield response.json();
651
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
652
- return apiResponse;
653
- }
654
- else {
655
- return response.json().then((e) => {
656
- return Promise.reject(e);
657
- });
658
- }
659
- }));
660
- };
661
- },
662
- };
663
- };
664
- exports.AccountsApiFp = AccountsApiFp;
665
- /**
666
- * AccountsApi - factory interface
667
- * @export
668
- */
669
- const AccountsApiFactory = function (configuration) {
670
- return {
671
- /**
672
- * Creates a new account
673
- * @summary Create a new account
674
- * @param {string} budget_id - The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
675
- * @param {PostAccountWrapper} data - The account to create.
676
- * @param {*} [options] - Override http request options.
677
- * @throws {RequiredError}
678
- */
679
- createAccount(budget_id, data, options) {
680
- return (0, exports.AccountsApiFp)(configuration).createAccount(budget_id, data, options)();
681
- },
682
- /**
683
- * Returns a single account
684
- * @summary Single account
685
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
686
- * @param {string} account_id - The id of the account
687
- * @param {*} [options] - Override http request options.
688
- * @throws {RequiredError}
689
- */
690
- getAccountById(budget_id, account_id, options) {
691
- return (0, exports.AccountsApiFp)(configuration).getAccountById(budget_id, account_id, options)();
692
- },
693
- /**
694
- * Returns all accounts
695
- * @summary Account list
696
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
697
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
698
- * @param {*} [options] - Override http request options.
699
- * @throws {RequiredError}
700
- */
701
- getAccounts(budget_id, last_knowledge_of_server, options) {
702
- return (0, exports.AccountsApiFp)(configuration).getAccounts(budget_id, last_knowledge_of_server, options)();
703
- },
704
- };
705
- };
706
- exports.AccountsApiFactory = AccountsApiFactory;
707
- /**
708
- * AccountsApi - object-oriented interface
709
- * @export
710
- * @class AccountsApi
711
- * @extends {BaseAPI}
712
- */
713
- class AccountsApi extends BaseAPI {
714
- /**
715
- * Creates a new account
716
- * @summary Create a new account
717
- * @param {string} budget_id - The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)
718
- * @param {PostAccountWrapper} data - The account to create.
719
- * @param {*} [options] - Override http request options.
720
- * @throws {RequiredError}
721
- * @memberof AccountsApi
722
- */
723
- createAccount(budget_id, data, options) {
724
- return (0, exports.AccountsApiFp)(this.configuration).createAccount(budget_id, data, options)();
725
- }
726
- /**
727
- * Returns a single account
728
- * @summary Single account
729
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
730
- * @param {string} account_id - The id of the account
731
- * @param {*} [options] - Override http request options.
732
- * @throws {RequiredError}
733
- * @memberof AccountsApi
734
- */
735
- getAccountById(budget_id, account_id, options) {
736
- return (0, exports.AccountsApiFp)(this.configuration).getAccountById(budget_id, account_id, options)();
737
- }
738
- /**
739
- * Returns all accounts
740
- * @summary Account list
741
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
742
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
743
- * @param {*} [options] - Override http request options.
744
- * @throws {RequiredError}
745
- * @memberof AccountsApi
746
- */
747
- getAccounts(budget_id, last_knowledge_of_server, options) {
748
- return (0, exports.AccountsApiFp)(this.configuration).getAccounts(budget_id, last_knowledge_of_server, options)();
749
- }
750
- }
751
- exports.AccountsApi = AccountsApi;
752
- /**
753
- * BudgetsApi - fetch parameter creator
754
- * @export
755
- */
756
- const BudgetsApiFetchParamCreator = function (configuration) {
757
- return {
758
- /**
759
- * Returns a single budget with all related entities. This resource is effectively a full budget export.
760
- * @summary Single budget
761
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
762
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
763
- * @param {*} [options] - Override http request options.
764
- * @throws {RequiredError}
765
- */
766
- getBudgetById(budget_id, last_knowledge_of_server, options = {}) {
767
- // verify required parameter 'budget_id' is not null or undefined
768
- if (budget_id === null || budget_id === undefined) {
769
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getBudgetById.');
770
- }
771
- const localVarPath = `/budgets/{budget_id}`
772
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
773
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
774
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
775
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
776
- const localVarHeaderParameter = {};
777
- const localVarQueryParameter = {};
778
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
779
- localVarHeaderParameter["Accept"] = "application/json";
780
- // authentication bearer required
781
- if (configuration && configuration.apiKey) {
782
- const localVarApiKeyValue = configuration.apiKey;
783
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
784
- }
785
- if (last_knowledge_of_server !== undefined) {
786
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
787
- }
788
- const query = new URLSearchParams(localVarUrlObj.search);
789
- for (const key in localVarQueryParameter) {
790
- query.set(key, localVarQueryParameter[key]);
791
- }
792
- for (const key in options.query) {
793
- query.set(key, options.query[key]);
794
- }
795
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
796
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
797
- return {
798
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
799
- options: localVarRequestOptions,
800
- };
801
- },
802
- /**
803
- * Returns settings for a budget
804
- * @summary Budget Settings
805
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
806
- * @param {*} [options] - Override http request options.
807
- * @throws {RequiredError}
808
- */
809
- getBudgetSettingsById(budget_id, options = {}) {
810
- // verify required parameter 'budget_id' is not null or undefined
811
- if (budget_id === null || budget_id === undefined) {
812
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getBudgetSettingsById.');
813
- }
814
- const localVarPath = `/budgets/{budget_id}/settings`
815
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
816
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
817
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
818
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
819
- const localVarHeaderParameter = {};
820
- const localVarQueryParameter = {};
821
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
822
- localVarHeaderParameter["Accept"] = "application/json";
823
- // authentication bearer required
824
- if (configuration && configuration.apiKey) {
825
- const localVarApiKeyValue = configuration.apiKey;
826
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
827
- }
828
- const query = new URLSearchParams(localVarUrlObj.search);
829
- for (const key in localVarQueryParameter) {
830
- query.set(key, localVarQueryParameter[key]);
831
- }
832
- for (const key in options.query) {
833
- query.set(key, options.query[key]);
834
- }
835
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
836
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
837
- return {
838
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
839
- options: localVarRequestOptions,
840
- };
841
- },
842
- /**
843
- * Returns budgets list with summary information
844
- * @summary List budgets
845
- * @param {boolean} [include_accounts] - Whether to include the list of budget accounts
846
- * @param {*} [options] - Override http request options.
847
- * @throws {RequiredError}
848
- */
849
- getBudgets(include_accounts, options = {}) {
850
- const localVarPath = `/budgets`;
851
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
852
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
853
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
854
- const localVarHeaderParameter = {};
855
- const localVarQueryParameter = {};
856
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
857
- localVarHeaderParameter["Accept"] = "application/json";
858
- // authentication bearer required
859
- if (configuration && configuration.apiKey) {
860
- const localVarApiKeyValue = configuration.apiKey;
861
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
862
- }
863
- if (include_accounts !== undefined) {
864
- localVarQueryParameter['include_accounts'] = include_accounts;
865
- }
866
- const query = new URLSearchParams(localVarUrlObj.search);
867
- for (const key in localVarQueryParameter) {
868
- query.set(key, localVarQueryParameter[key]);
869
- }
870
- for (const key in options.query) {
871
- query.set(key, options.query[key]);
872
- }
873
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
874
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
875
- return {
876
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
877
- options: localVarRequestOptions,
878
- };
879
- },
880
- };
881
- };
882
- exports.BudgetsApiFetchParamCreator = BudgetsApiFetchParamCreator;
883
- /**
884
- * BudgetsApi - functional programming interface
885
- * @export
886
- */
887
- const BudgetsApiFp = function (configuration) {
888
- return {
889
- /**
890
- * Returns a single budget with all related entities. This resource is effectively a full budget export.
891
- * @summary Single budget
892
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
893
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
894
- * @param {*} [options] - Override http request options.
895
- * @throws {RequiredError}
896
- */
897
- getBudgetById(budget_id, last_knowledge_of_server, options) {
898
- const localVarFetchArgs = (0, exports.BudgetsApiFetchParamCreator)(configuration).getBudgetById(budget_id, last_knowledge_of_server, options);
899
- return (fetchFunction = fetch) => {
900
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
901
- if (response.status >= 200 && response.status < 300) {
902
- const apiResponse = yield response.json();
903
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
904
- return apiResponse;
905
- }
906
- else {
907
- return response.json().then((e) => {
908
- return Promise.reject(e);
909
- });
910
- }
911
- }));
912
- };
913
- },
914
- /**
915
- * Returns settings for a budget
916
- * @summary Budget Settings
917
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
918
- * @param {*} [options] - Override http request options.
919
- * @throws {RequiredError}
920
- */
921
- getBudgetSettingsById(budget_id, options) {
922
- const localVarFetchArgs = (0, exports.BudgetsApiFetchParamCreator)(configuration).getBudgetSettingsById(budget_id, options);
923
- return (fetchFunction = fetch) => {
924
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
925
- if (response.status >= 200 && response.status < 300) {
926
- const apiResponse = yield response.json();
927
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
928
- return apiResponse;
929
- }
930
- else {
931
- return response.json().then((e) => {
932
- return Promise.reject(e);
933
- });
934
- }
935
- }));
936
- };
937
- },
938
- /**
939
- * Returns budgets list with summary information
940
- * @summary List budgets
941
- * @param {boolean} [include_accounts] - Whether to include the list of budget accounts
942
- * @param {*} [options] - Override http request options.
943
- * @throws {RequiredError}
944
- */
945
- getBudgets(include_accounts, options) {
946
- const localVarFetchArgs = (0, exports.BudgetsApiFetchParamCreator)(configuration).getBudgets(include_accounts, options);
947
- return (fetchFunction = fetch) => {
948
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
949
- if (response.status >= 200 && response.status < 300) {
950
- const apiResponse = yield response.json();
951
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
952
- return apiResponse;
953
- }
954
- else {
955
- return response.json().then((e) => {
956
- return Promise.reject(e);
957
- });
958
- }
959
- }));
960
- };
961
- },
962
- };
963
- };
964
- exports.BudgetsApiFp = BudgetsApiFp;
965
- /**
966
- * BudgetsApi - factory interface
967
- * @export
968
- */
969
- const BudgetsApiFactory = function (configuration) {
970
- return {
971
- /**
972
- * Returns a single budget with all related entities. This resource is effectively a full budget export.
973
- * @summary Single budget
974
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
975
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
976
- * @param {*} [options] - Override http request options.
977
- * @throws {RequiredError}
978
- */
979
- getBudgetById(budget_id, last_knowledge_of_server, options) {
980
- return (0, exports.BudgetsApiFp)(configuration).getBudgetById(budget_id, last_knowledge_of_server, options)();
981
- },
982
- /**
983
- * Returns settings for a budget
984
- * @summary Budget Settings
985
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
986
- * @param {*} [options] - Override http request options.
987
- * @throws {RequiredError}
988
- */
989
- getBudgetSettingsById(budget_id, options) {
990
- return (0, exports.BudgetsApiFp)(configuration).getBudgetSettingsById(budget_id, options)();
991
- },
992
- /**
993
- * Returns budgets list with summary information
994
- * @summary List budgets
995
- * @param {boolean} [include_accounts] - Whether to include the list of budget accounts
996
- * @param {*} [options] - Override http request options.
997
- * @throws {RequiredError}
998
- */
999
- getBudgets(include_accounts, options) {
1000
- return (0, exports.BudgetsApiFp)(configuration).getBudgets(include_accounts, options)();
1001
- },
1002
- };
1003
- };
1004
- exports.BudgetsApiFactory = BudgetsApiFactory;
1005
- /**
1006
- * BudgetsApi - object-oriented interface
1007
- * @export
1008
- * @class BudgetsApi
1009
- * @extends {BaseAPI}
1010
- */
1011
- class BudgetsApi extends BaseAPI {
1012
- /**
1013
- * Returns a single budget with all related entities. This resource is effectively a full budget export.
1014
- * @summary Single budget
1015
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1016
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1017
- * @param {*} [options] - Override http request options.
1018
- * @throws {RequiredError}
1019
- * @memberof BudgetsApi
1020
- */
1021
- getBudgetById(budget_id, last_knowledge_of_server, options) {
1022
- return (0, exports.BudgetsApiFp)(this.configuration).getBudgetById(budget_id, last_knowledge_of_server, options)();
1023
- }
1024
- /**
1025
- * Returns settings for a budget
1026
- * @summary Budget Settings
1027
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1028
- * @param {*} [options] - Override http request options.
1029
- * @throws {RequiredError}
1030
- * @memberof BudgetsApi
1031
- */
1032
- getBudgetSettingsById(budget_id, options) {
1033
- return (0, exports.BudgetsApiFp)(this.configuration).getBudgetSettingsById(budget_id, options)();
1034
- }
1035
- /**
1036
- * Returns budgets list with summary information
1037
- * @summary List budgets
1038
- * @param {boolean} [include_accounts] - Whether to include the list of budget accounts
1039
- * @param {*} [options] - Override http request options.
1040
- * @throws {RequiredError}
1041
- * @memberof BudgetsApi
1042
- */
1043
- getBudgets(include_accounts, options) {
1044
- return (0, exports.BudgetsApiFp)(this.configuration).getBudgets(include_accounts, options)();
1045
- }
1046
- }
1047
- exports.BudgetsApi = BudgetsApi;
1048
- /**
1049
- * CategoriesApi - fetch parameter creator
1050
- * @export
1051
- */
1052
- const CategoriesApiFetchParamCreator = function (configuration) {
1053
- return {
1054
- /**
1055
- * Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1056
- * @summary List categories
1057
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1058
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1059
- * @param {*} [options] - Override http request options.
1060
- * @throws {RequiredError}
1061
- */
1062
- getCategories(budget_id, last_knowledge_of_server, options = {}) {
1063
- // verify required parameter 'budget_id' is not null or undefined
1064
- if (budget_id === null || budget_id === undefined) {
1065
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getCategories.');
1066
- }
1067
- const localVarPath = `/budgets/{budget_id}/categories`
1068
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
1069
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1070
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1071
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1072
- const localVarHeaderParameter = {};
1073
- const localVarQueryParameter = {};
1074
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1075
- localVarHeaderParameter["Accept"] = "application/json";
1076
- // authentication bearer required
1077
- if (configuration && configuration.apiKey) {
1078
- const localVarApiKeyValue = configuration.apiKey;
1079
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1080
- }
1081
- if (last_knowledge_of_server !== undefined) {
1082
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
1083
- }
1084
- const query = new URLSearchParams(localVarUrlObj.search);
1085
- for (const key in localVarQueryParameter) {
1086
- query.set(key, localVarQueryParameter[key]);
1087
- }
1088
- for (const key in options.query) {
1089
- query.set(key, options.query[key]);
1090
- }
1091
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1092
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1093
- return {
1094
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1095
- options: localVarRequestOptions,
1096
- };
1097
- },
1098
- /**
1099
- * Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1100
- * @summary Single category
1101
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1102
- * @param {string} category_id - The id of the category
1103
- * @param {*} [options] - Override http request options.
1104
- * @throws {RequiredError}
1105
- */
1106
- getCategoryById(budget_id, category_id, options = {}) {
1107
- // verify required parameter 'budget_id' is not null or undefined
1108
- if (budget_id === null || budget_id === undefined) {
1109
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getCategoryById.');
1110
- }
1111
- // verify required parameter 'category_id' is not null or undefined
1112
- if (category_id === null || category_id === undefined) {
1113
- throw new RequiredError('category_id', 'Required parameter category_id was null or undefined when calling getCategoryById.');
1114
- }
1115
- const localVarPath = `/budgets/{budget_id}/categories/{category_id}`
1116
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
1117
- .replace(`{${"category_id"}}`, encodeURIComponent(String(category_id)));
1118
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1119
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1120
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1121
- const localVarHeaderParameter = {};
1122
- const localVarQueryParameter = {};
1123
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1124
- localVarHeaderParameter["Accept"] = "application/json";
1125
- // authentication bearer required
1126
- if (configuration && configuration.apiKey) {
1127
- const localVarApiKeyValue = configuration.apiKey;
1128
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1129
- }
1130
- const query = new URLSearchParams(localVarUrlObj.search);
1131
- for (const key in localVarQueryParameter) {
1132
- query.set(key, localVarQueryParameter[key]);
1133
- }
1134
- for (const key in options.query) {
1135
- query.set(key, options.query[key]);
1136
- }
1137
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1138
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1139
- return {
1140
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1141
- options: localVarRequestOptions,
1142
- };
1143
- },
1144
- /**
1145
- * Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1146
- * @summary Single category for a specific budget month
1147
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1148
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1149
- * @param {string} category_id - The id of the category
1150
- * @param {*} [options] - Override http request options.
1151
- * @throws {RequiredError}
1152
- */
1153
- getMonthCategoryById(budget_id, month, category_id, options = {}) {
1154
- // verify required parameter 'budget_id' is not null or undefined
1155
- if (budget_id === null || budget_id === undefined) {
1156
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getMonthCategoryById.');
1157
- }
1158
- // verify required parameter 'month' is not null or undefined
1159
- if (month === null || month === undefined) {
1160
- throw new RequiredError('month', 'Required parameter month was null or undefined when calling getMonthCategoryById.');
1161
- }
1162
- // verify required parameter 'category_id' is not null or undefined
1163
- if (category_id === null || category_id === undefined) {
1164
- throw new RequiredError('category_id', 'Required parameter category_id was null or undefined when calling getMonthCategoryById.');
1165
- }
1166
- const localVarPath = `/budgets/{budget_id}/months/{month}/categories/{category_id}`
1167
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
1168
- .replace(`{${"month"}}`, encodeURIComponent(convertDateToFullDateStringFormat(month)))
1169
- .replace(`{${"category_id"}}`, encodeURIComponent(String(category_id)));
1170
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1171
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1172
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1173
- const localVarHeaderParameter = {};
1174
- const localVarQueryParameter = {};
1175
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1176
- localVarHeaderParameter["Accept"] = "application/json";
1177
- // authentication bearer required
1178
- if (configuration && configuration.apiKey) {
1179
- const localVarApiKeyValue = configuration.apiKey;
1180
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1181
- }
1182
- const query = new URLSearchParams(localVarUrlObj.search);
1183
- for (const key in localVarQueryParameter) {
1184
- query.set(key, localVarQueryParameter[key]);
1185
- }
1186
- for (const key in options.query) {
1187
- query.set(key, options.query[key]);
1188
- }
1189
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1190
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1191
- return {
1192
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1193
- options: localVarRequestOptions,
1194
- };
1195
- },
1196
- /**
1197
- * Update a category for a specific month. Only `budgeted` amount can be updated.
1198
- * @summary Update a category for a specific month
1199
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1200
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1201
- * @param {string} category_id - The id of the category
1202
- * @param {PatchMonthCategoryWrapper} data - The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
1203
- * @param {*} [options] - Override http request options.
1204
- * @throws {RequiredError}
1205
- */
1206
- updateMonthCategory(budget_id, month, category_id, data, options = {}) {
1207
- // verify required parameter 'budget_id' is not null or undefined
1208
- if (budget_id === null || budget_id === undefined) {
1209
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling updateMonthCategory.');
1210
- }
1211
- // verify required parameter 'month' is not null or undefined
1212
- if (month === null || month === undefined) {
1213
- throw new RequiredError('month', 'Required parameter month was null or undefined when calling updateMonthCategory.');
1214
- }
1215
- // verify required parameter 'category_id' is not null or undefined
1216
- if (category_id === null || category_id === undefined) {
1217
- throw new RequiredError('category_id', 'Required parameter category_id was null or undefined when calling updateMonthCategory.');
1218
- }
1219
- // verify required parameter 'data' is not null or undefined
1220
- if (data === null || data === undefined) {
1221
- throw new RequiredError('data', 'Required parameter data was null or undefined when calling updateMonthCategory.');
1222
- }
1223
- const localVarPath = `/budgets/{budget_id}/months/{month}/categories/{category_id}`
1224
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
1225
- .replace(`{${"month"}}`, encodeURIComponent(convertDateToFullDateStringFormat(month)))
1226
- .replace(`{${"category_id"}}`, encodeURIComponent(String(category_id)));
1227
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1228
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1229
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, options);
1230
- const localVarHeaderParameter = {};
1231
- const localVarQueryParameter = {};
1232
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1233
- localVarHeaderParameter["Accept"] = "application/json";
1234
- // authentication bearer required
1235
- if (configuration && configuration.apiKey) {
1236
- const localVarApiKeyValue = configuration.apiKey;
1237
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1238
- }
1239
- localVarHeaderParameter['Content-Type'] = 'application/json';
1240
- const query = new URLSearchParams(localVarUrlObj.search);
1241
- for (const key in localVarQueryParameter) {
1242
- query.set(key, localVarQueryParameter[key]);
1243
- }
1244
- for (const key in options.query) {
1245
- query.set(key, options.query[key]);
1246
- }
1247
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1248
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1249
- localVarRequestOptions.body = JSON.stringify(data || {});
1250
- return {
1251
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1252
- options: localVarRequestOptions,
1253
- };
1254
- },
1255
- };
1256
- };
1257
- exports.CategoriesApiFetchParamCreator = CategoriesApiFetchParamCreator;
1258
- /**
1259
- * CategoriesApi - functional programming interface
1260
- * @export
1261
- */
1262
- const CategoriesApiFp = function (configuration) {
1263
- return {
1264
- /**
1265
- * Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1266
- * @summary List categories
1267
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1268
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1269
- * @param {*} [options] - Override http request options.
1270
- * @throws {RequiredError}
1271
- */
1272
- getCategories(budget_id, last_knowledge_of_server, options) {
1273
- const localVarFetchArgs = (0, exports.CategoriesApiFetchParamCreator)(configuration).getCategories(budget_id, last_knowledge_of_server, options);
1274
- return (fetchFunction = fetch) => {
1275
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1276
- if (response.status >= 200 && response.status < 300) {
1277
- const apiResponse = yield response.json();
1278
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1279
- return apiResponse;
1280
- }
1281
- else {
1282
- return response.json().then((e) => {
1283
- return Promise.reject(e);
1284
- });
1285
- }
1286
- }));
1287
- };
1288
- },
1289
- /**
1290
- * Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1291
- * @summary Single category
1292
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1293
- * @param {string} category_id - The id of the category
1294
- * @param {*} [options] - Override http request options.
1295
- * @throws {RequiredError}
1296
- */
1297
- getCategoryById(budget_id, category_id, options) {
1298
- const localVarFetchArgs = (0, exports.CategoriesApiFetchParamCreator)(configuration).getCategoryById(budget_id, category_id, options);
1299
- return (fetchFunction = fetch) => {
1300
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1301
- if (response.status >= 200 && response.status < 300) {
1302
- const apiResponse = yield response.json();
1303
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1304
- return apiResponse;
1305
- }
1306
- else {
1307
- return response.json().then((e) => {
1308
- return Promise.reject(e);
1309
- });
1310
- }
1311
- }));
1312
- };
1313
- },
1314
- /**
1315
- * Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1316
- * @summary Single category for a specific budget month
1317
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1318
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1319
- * @param {string} category_id - The id of the category
1320
- * @param {*} [options] - Override http request options.
1321
- * @throws {RequiredError}
1322
- */
1323
- getMonthCategoryById(budget_id, month, category_id, options) {
1324
- const localVarFetchArgs = (0, exports.CategoriesApiFetchParamCreator)(configuration).getMonthCategoryById(budget_id, month, category_id, options);
1325
- return (fetchFunction = fetch) => {
1326
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1327
- if (response.status >= 200 && response.status < 300) {
1328
- const apiResponse = yield response.json();
1329
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1330
- return apiResponse;
1331
- }
1332
- else {
1333
- return response.json().then((e) => {
1334
- return Promise.reject(e);
1335
- });
1336
- }
1337
- }));
1338
- };
1339
- },
1340
- /**
1341
- * Update a category for a specific month. Only `budgeted` amount can be updated.
1342
- * @summary Update a category for a specific month
1343
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1344
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1345
- * @param {string} category_id - The id of the category
1346
- * @param {PatchMonthCategoryWrapper} data - The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
1347
- * @param {*} [options] - Override http request options.
1348
- * @throws {RequiredError}
1349
- */
1350
- updateMonthCategory(budget_id, month, category_id, data, options) {
1351
- const localVarFetchArgs = (0, exports.CategoriesApiFetchParamCreator)(configuration).updateMonthCategory(budget_id, month, category_id, data, options);
1352
- return (fetchFunction = fetch) => {
1353
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1354
- if (response.status >= 200 && response.status < 300) {
1355
- const apiResponse = yield response.json();
1356
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1357
- return apiResponse;
1358
- }
1359
- else {
1360
- return response.json().then((e) => {
1361
- return Promise.reject(e);
1362
- });
1363
- }
1364
- }));
1365
- };
1366
- },
1367
- };
1368
- };
1369
- exports.CategoriesApiFp = CategoriesApiFp;
1370
- /**
1371
- * CategoriesApi - factory interface
1372
- * @export
1373
- */
1374
- const CategoriesApiFactory = function (configuration) {
1375
- return {
1376
- /**
1377
- * Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1378
- * @summary List categories
1379
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1380
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1381
- * @param {*} [options] - Override http request options.
1382
- * @throws {RequiredError}
1383
- */
1384
- getCategories(budget_id, last_knowledge_of_server, options) {
1385
- return (0, exports.CategoriesApiFp)(configuration).getCategories(budget_id, last_knowledge_of_server, options)();
1386
- },
1387
- /**
1388
- * Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1389
- * @summary Single category
1390
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1391
- * @param {string} category_id - The id of the category
1392
- * @param {*} [options] - Override http request options.
1393
- * @throws {RequiredError}
1394
- */
1395
- getCategoryById(budget_id, category_id, options) {
1396
- return (0, exports.CategoriesApiFp)(configuration).getCategoryById(budget_id, category_id, options)();
1397
- },
1398
- /**
1399
- * Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1400
- * @summary Single category for a specific budget month
1401
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1402
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1403
- * @param {string} category_id - The id of the category
1404
- * @param {*} [options] - Override http request options.
1405
- * @throws {RequiredError}
1406
- */
1407
- getMonthCategoryById(budget_id, month, category_id, options) {
1408
- return (0, exports.CategoriesApiFp)(configuration).getMonthCategoryById(budget_id, month, category_id, options)();
1409
- },
1410
- /**
1411
- * Update a category for a specific month. Only `budgeted` amount can be updated.
1412
- * @summary Update a category for a specific month
1413
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1414
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1415
- * @param {string} category_id - The id of the category
1416
- * @param {PatchMonthCategoryWrapper} data - The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
1417
- * @param {*} [options] - Override http request options.
1418
- * @throws {RequiredError}
1419
- */
1420
- updateMonthCategory(budget_id, month, category_id, data, options) {
1421
- return (0, exports.CategoriesApiFp)(configuration).updateMonthCategory(budget_id, month, category_id, data, options)();
1422
- },
1423
- };
1424
- };
1425
- exports.CategoriesApiFactory = CategoriesApiFactory;
1426
- /**
1427
- * CategoriesApi - object-oriented interface
1428
- * @export
1429
- * @class CategoriesApi
1430
- * @extends {BaseAPI}
1431
- */
1432
- class CategoriesApi extends BaseAPI {
1433
- /**
1434
- * Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1435
- * @summary List categories
1436
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1437
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1438
- * @param {*} [options] - Override http request options.
1439
- * @throws {RequiredError}
1440
- * @memberof CategoriesApi
1441
- */
1442
- getCategories(budget_id, last_knowledge_of_server, options) {
1443
- return (0, exports.CategoriesApiFp)(this.configuration).getCategories(budget_id, last_knowledge_of_server, options)();
1444
- }
1445
- /**
1446
- * Returns a single category. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1447
- * @summary Single category
1448
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1449
- * @param {string} category_id - The id of the category
1450
- * @param {*} [options] - Override http request options.
1451
- * @throws {RequiredError}
1452
- * @memberof CategoriesApi
1453
- */
1454
- getCategoryById(budget_id, category_id, options) {
1455
- return (0, exports.CategoriesApiFp)(this.configuration).getCategoryById(budget_id, category_id, options)();
1456
- }
1457
- /**
1458
- * Returns a single category for a specific budget month. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
1459
- * @summary Single category for a specific budget month
1460
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1461
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1462
- * @param {string} category_id - The id of the category
1463
- * @param {*} [options] - Override http request options.
1464
- * @throws {RequiredError}
1465
- * @memberof CategoriesApi
1466
- */
1467
- getMonthCategoryById(budget_id, month, category_id, options) {
1468
- return (0, exports.CategoriesApiFp)(this.configuration).getMonthCategoryById(budget_id, month, category_id, options)();
1469
- }
1470
- /**
1471
- * Update a category for a specific month. Only `budgeted` amount can be updated.
1472
- * @summary Update a category for a specific month
1473
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1474
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1475
- * @param {string} category_id - The id of the category
1476
- * @param {PatchMonthCategoryWrapper} data - The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored.
1477
- * @param {*} [options] - Override http request options.
1478
- * @throws {RequiredError}
1479
- * @memberof CategoriesApi
1480
- */
1481
- updateMonthCategory(budget_id, month, category_id, data, options) {
1482
- return (0, exports.CategoriesApiFp)(this.configuration).updateMonthCategory(budget_id, month, category_id, data, options)();
1483
- }
1484
- }
1485
- exports.CategoriesApi = CategoriesApi;
1486
- /**
1487
- * DeprecatedApi - fetch parameter creator
1488
- * @export
1489
- */
1490
- const DeprecatedApiFetchParamCreator = function (configuration) {
1491
- return {
1492
- /**
1493
- * Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.
1494
- * @summary Bulk create transactions
1495
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1496
- * @param {BulkTransactions} transactions - The list of transactions to create
1497
- * @param {*} [options] - Override http request options.
1498
- * @throws {RequiredError}
1499
- */
1500
- bulkCreateTransactions(budget_id, transactions, options = {}) {
1501
- // verify required parameter 'budget_id' is not null or undefined
1502
- if (budget_id === null || budget_id === undefined) {
1503
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling bulkCreateTransactions.');
1504
- }
1505
- // verify required parameter 'transactions' is not null or undefined
1506
- if (transactions === null || transactions === undefined) {
1507
- throw new RequiredError('transactions', 'Required parameter transactions was null or undefined when calling bulkCreateTransactions.');
1508
- }
1509
- const localVarPath = `/budgets/{budget_id}/transactions/bulk`
1510
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
1511
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1512
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1513
- const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1514
- const localVarHeaderParameter = {};
1515
- const localVarQueryParameter = {};
1516
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1517
- localVarHeaderParameter["Accept"] = "application/json";
1518
- // authentication bearer required
1519
- if (configuration && configuration.apiKey) {
1520
- const localVarApiKeyValue = configuration.apiKey;
1521
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1522
- }
1523
- localVarHeaderParameter['Content-Type'] = 'application/json';
1524
- const query = new URLSearchParams(localVarUrlObj.search);
1525
- for (const key in localVarQueryParameter) {
1526
- query.set(key, localVarQueryParameter[key]);
1527
- }
1528
- for (const key in options.query) {
1529
- query.set(key, options.query[key]);
1530
- }
1531
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1532
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1533
- localVarRequestOptions.body = JSON.stringify(transactions || {});
1534
- return {
1535
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1536
- options: localVarRequestOptions,
1537
- };
1538
- },
1539
- };
1540
- };
1541
- exports.DeprecatedApiFetchParamCreator = DeprecatedApiFetchParamCreator;
1542
- /**
1543
- * DeprecatedApi - functional programming interface
1544
- * @export
1545
- */
1546
- const DeprecatedApiFp = function (configuration) {
1547
- return {
1548
- /**
1549
- * Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.
1550
- * @summary Bulk create transactions
1551
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1552
- * @param {BulkTransactions} transactions - The list of transactions to create
1553
- * @param {*} [options] - Override http request options.
1554
- * @throws {RequiredError}
1555
- */
1556
- bulkCreateTransactions(budget_id, transactions, options) {
1557
- const localVarFetchArgs = (0, exports.DeprecatedApiFetchParamCreator)(configuration).bulkCreateTransactions(budget_id, transactions, options);
1558
- return (fetchFunction = fetch) => {
1559
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1560
- if (response.status >= 200 && response.status < 300) {
1561
- const apiResponse = yield response.json();
1562
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1563
- return apiResponse;
1564
- }
1565
- else {
1566
- return response.json().then((e) => {
1567
- return Promise.reject(e);
1568
- });
1569
- }
1570
- }));
1571
- };
1572
- },
1573
- };
1574
- };
1575
- exports.DeprecatedApiFp = DeprecatedApiFp;
1576
- /**
1577
- * DeprecatedApi - factory interface
1578
- * @export
1579
- */
1580
- const DeprecatedApiFactory = function (configuration) {
1581
- return {
1582
- /**
1583
- * Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.
1584
- * @summary Bulk create transactions
1585
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1586
- * @param {BulkTransactions} transactions - The list of transactions to create
1587
- * @param {*} [options] - Override http request options.
1588
- * @throws {RequiredError}
1589
- */
1590
- bulkCreateTransactions(budget_id, transactions, options) {
1591
- return (0, exports.DeprecatedApiFp)(configuration).bulkCreateTransactions(budget_id, transactions, options)();
1592
- },
1593
- };
1594
- };
1595
- exports.DeprecatedApiFactory = DeprecatedApiFactory;
1596
- /**
1597
- * DeprecatedApi - object-oriented interface
1598
- * @export
1599
- * @class DeprecatedApi
1600
- * @extends {BaseAPI}
1601
- */
1602
- class DeprecatedApi extends BaseAPI {
1603
- /**
1604
- * Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions.
1605
- * @summary Bulk create transactions
1606
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1607
- * @param {BulkTransactions} transactions - The list of transactions to create
1608
- * @param {*} [options] - Override http request options.
1609
- * @throws {RequiredError}
1610
- * @memberof DeprecatedApi
1611
- */
1612
- bulkCreateTransactions(budget_id, transactions, options) {
1613
- return (0, exports.DeprecatedApiFp)(this.configuration).bulkCreateTransactions(budget_id, transactions, options)();
1614
- }
1615
- }
1616
- exports.DeprecatedApi = DeprecatedApi;
1617
- /**
1618
- * MonthsApi - fetch parameter creator
1619
- * @export
1620
- */
1621
- const MonthsApiFetchParamCreator = function (configuration) {
1622
- return {
1623
- /**
1624
- * Returns a single budget month
1625
- * @summary Single budget month
1626
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1627
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1628
- * @param {*} [options] - Override http request options.
1629
- * @throws {RequiredError}
1630
- */
1631
- getBudgetMonth(budget_id, month, options = {}) {
1632
- // verify required parameter 'budget_id' is not null or undefined
1633
- if (budget_id === null || budget_id === undefined) {
1634
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getBudgetMonth.');
1635
- }
1636
- // verify required parameter 'month' is not null or undefined
1637
- if (month === null || month === undefined) {
1638
- throw new RequiredError('month', 'Required parameter month was null or undefined when calling getBudgetMonth.');
1639
- }
1640
- const localVarPath = `/budgets/{budget_id}/months/{month}`
1641
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
1642
- .replace(`{${"month"}}`, encodeURIComponent(convertDateToFullDateStringFormat(month)));
1643
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1644
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1645
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1646
- const localVarHeaderParameter = {};
1647
- const localVarQueryParameter = {};
1648
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1649
- localVarHeaderParameter["Accept"] = "application/json";
1650
- // authentication bearer required
1651
- if (configuration && configuration.apiKey) {
1652
- const localVarApiKeyValue = configuration.apiKey;
1653
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1654
- }
1655
- const query = new URLSearchParams(localVarUrlObj.search);
1656
- for (const key in localVarQueryParameter) {
1657
- query.set(key, localVarQueryParameter[key]);
1658
- }
1659
- for (const key in options.query) {
1660
- query.set(key, options.query[key]);
1661
- }
1662
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1663
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1664
- return {
1665
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1666
- options: localVarRequestOptions,
1667
- };
1668
- },
1669
- /**
1670
- * Returns all budget months
1671
- * @summary List budget months
1672
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1673
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1674
- * @param {*} [options] - Override http request options.
1675
- * @throws {RequiredError}
1676
- */
1677
- getBudgetMonths(budget_id, last_knowledge_of_server, options = {}) {
1678
- // verify required parameter 'budget_id' is not null or undefined
1679
- if (budget_id === null || budget_id === undefined) {
1680
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getBudgetMonths.');
1681
- }
1682
- const localVarPath = `/budgets/{budget_id}/months`
1683
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
1684
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1685
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1686
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1687
- const localVarHeaderParameter = {};
1688
- const localVarQueryParameter = {};
1689
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1690
- localVarHeaderParameter["Accept"] = "application/json";
1691
- // authentication bearer required
1692
- if (configuration && configuration.apiKey) {
1693
- const localVarApiKeyValue = configuration.apiKey;
1694
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1695
- }
1696
- if (last_knowledge_of_server !== undefined) {
1697
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
1698
- }
1699
- const query = new URLSearchParams(localVarUrlObj.search);
1700
- for (const key in localVarQueryParameter) {
1701
- query.set(key, localVarQueryParameter[key]);
1702
- }
1703
- for (const key in options.query) {
1704
- query.set(key, options.query[key]);
1705
- }
1706
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1707
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1708
- return {
1709
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1710
- options: localVarRequestOptions,
1711
- };
1712
- },
1713
- };
1714
- };
1715
- exports.MonthsApiFetchParamCreator = MonthsApiFetchParamCreator;
1716
- /**
1717
- * MonthsApi - functional programming interface
1718
- * @export
1719
- */
1720
- const MonthsApiFp = function (configuration) {
1721
- return {
1722
- /**
1723
- * Returns a single budget month
1724
- * @summary Single budget month
1725
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1726
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1727
- * @param {*} [options] - Override http request options.
1728
- * @throws {RequiredError}
1729
- */
1730
- getBudgetMonth(budget_id, month, options) {
1731
- const localVarFetchArgs = (0, exports.MonthsApiFetchParamCreator)(configuration).getBudgetMonth(budget_id, month, options);
1732
- return (fetchFunction = fetch) => {
1733
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1734
- if (response.status >= 200 && response.status < 300) {
1735
- const apiResponse = yield response.json();
1736
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1737
- return apiResponse;
1738
- }
1739
- else {
1740
- return response.json().then((e) => {
1741
- return Promise.reject(e);
1742
- });
1743
- }
1744
- }));
1745
- };
1746
- },
1747
- /**
1748
- * Returns all budget months
1749
- * @summary List budget months
1750
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1751
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1752
- * @param {*} [options] - Override http request options.
1753
- * @throws {RequiredError}
1754
- */
1755
- getBudgetMonths(budget_id, last_knowledge_of_server, options) {
1756
- const localVarFetchArgs = (0, exports.MonthsApiFetchParamCreator)(configuration).getBudgetMonths(budget_id, last_knowledge_of_server, options);
1757
- return (fetchFunction = fetch) => {
1758
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1759
- if (response.status >= 200 && response.status < 300) {
1760
- const apiResponse = yield response.json();
1761
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1762
- return apiResponse;
1763
- }
1764
- else {
1765
- return response.json().then((e) => {
1766
- return Promise.reject(e);
1767
- });
1768
- }
1769
- }));
1770
- };
1771
- },
1772
- };
1773
- };
1774
- exports.MonthsApiFp = MonthsApiFp;
1775
- /**
1776
- * MonthsApi - factory interface
1777
- * @export
1778
- */
1779
- const MonthsApiFactory = function (configuration) {
1780
- return {
1781
- /**
1782
- * Returns a single budget month
1783
- * @summary Single budget month
1784
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1785
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1786
- * @param {*} [options] - Override http request options.
1787
- * @throws {RequiredError}
1788
- */
1789
- getBudgetMonth(budget_id, month, options) {
1790
- return (0, exports.MonthsApiFp)(configuration).getBudgetMonth(budget_id, month, options)();
1791
- },
1792
- /**
1793
- * Returns all budget months
1794
- * @summary List budget months
1795
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1796
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1797
- * @param {*} [options] - Override http request options.
1798
- * @throws {RequiredError}
1799
- */
1800
- getBudgetMonths(budget_id, last_knowledge_of_server, options) {
1801
- return (0, exports.MonthsApiFp)(configuration).getBudgetMonths(budget_id, last_knowledge_of_server, options)();
1802
- },
1803
- };
1804
- };
1805
- exports.MonthsApiFactory = MonthsApiFactory;
1806
- /**
1807
- * MonthsApi - object-oriented interface
1808
- * @export
1809
- * @class MonthsApi
1810
- * @extends {BaseAPI}
1811
- */
1812
- class MonthsApi extends BaseAPI {
1813
- /**
1814
- * Returns a single budget month
1815
- * @summary Single budget month
1816
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1817
- * @param {Date} month - The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))
1818
- * @param {*} [options] - Override http request options.
1819
- * @throws {RequiredError}
1820
- * @memberof MonthsApi
1821
- */
1822
- getBudgetMonth(budget_id, month, options) {
1823
- return (0, exports.MonthsApiFp)(this.configuration).getBudgetMonth(budget_id, month, options)();
1824
- }
1825
- /**
1826
- * Returns all budget months
1827
- * @summary List budget months
1828
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1829
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
1830
- * @param {*} [options] - Override http request options.
1831
- * @throws {RequiredError}
1832
- * @memberof MonthsApi
1833
- */
1834
- getBudgetMonths(budget_id, last_knowledge_of_server, options) {
1835
- return (0, exports.MonthsApiFp)(this.configuration).getBudgetMonths(budget_id, last_knowledge_of_server, options)();
1836
- }
1837
- }
1838
- exports.MonthsApi = MonthsApi;
1839
- /**
1840
- * PayeeLocationsApi - fetch parameter creator
1841
- * @export
1842
- */
1843
- const PayeeLocationsApiFetchParamCreator = function (configuration) {
1844
- return {
1845
- /**
1846
- * Returns a single payee location
1847
- * @summary Single payee location
1848
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1849
- * @param {string} payee_location_id - id of payee location
1850
- * @param {*} [options] - Override http request options.
1851
- * @throws {RequiredError}
1852
- */
1853
- getPayeeLocationById(budget_id, payee_location_id, options = {}) {
1854
- // verify required parameter 'budget_id' is not null or undefined
1855
- if (budget_id === null || budget_id === undefined) {
1856
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getPayeeLocationById.');
1857
- }
1858
- // verify required parameter 'payee_location_id' is not null or undefined
1859
- if (payee_location_id === null || payee_location_id === undefined) {
1860
- throw new RequiredError('payee_location_id', 'Required parameter payee_location_id was null or undefined when calling getPayeeLocationById.');
1861
- }
1862
- const localVarPath = `/budgets/{budget_id}/payee_locations/{payee_location_id}`
1863
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
1864
- .replace(`{${"payee_location_id"}}`, encodeURIComponent(String(payee_location_id)));
1865
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1866
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1867
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1868
- const localVarHeaderParameter = {};
1869
- const localVarQueryParameter = {};
1870
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1871
- localVarHeaderParameter["Accept"] = "application/json";
1872
- // authentication bearer required
1873
- if (configuration && configuration.apiKey) {
1874
- const localVarApiKeyValue = configuration.apiKey;
1875
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1876
- }
1877
- const query = new URLSearchParams(localVarUrlObj.search);
1878
- for (const key in localVarQueryParameter) {
1879
- query.set(key, localVarQueryParameter[key]);
1880
- }
1881
- for (const key in options.query) {
1882
- query.set(key, options.query[key]);
1883
- }
1884
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1885
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1886
- return {
1887
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1888
- options: localVarRequestOptions,
1889
- };
1890
- },
1891
- /**
1892
- * Returns all payee locations
1893
- * @summary List payee locations
1894
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1895
- * @param {*} [options] - Override http request options.
1896
- * @throws {RequiredError}
1897
- */
1898
- getPayeeLocations(budget_id, options = {}) {
1899
- // verify required parameter 'budget_id' is not null or undefined
1900
- if (budget_id === null || budget_id === undefined) {
1901
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getPayeeLocations.');
1902
- }
1903
- const localVarPath = `/budgets/{budget_id}/payee_locations`
1904
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
1905
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1906
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1907
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1908
- const localVarHeaderParameter = {};
1909
- const localVarQueryParameter = {};
1910
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1911
- localVarHeaderParameter["Accept"] = "application/json";
1912
- // authentication bearer required
1913
- if (configuration && configuration.apiKey) {
1914
- const localVarApiKeyValue = configuration.apiKey;
1915
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1916
- }
1917
- const query = new URLSearchParams(localVarUrlObj.search);
1918
- for (const key in localVarQueryParameter) {
1919
- query.set(key, localVarQueryParameter[key]);
1920
- }
1921
- for (const key in options.query) {
1922
- query.set(key, options.query[key]);
1923
- }
1924
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1925
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1926
- return {
1927
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1928
- options: localVarRequestOptions,
1929
- };
1930
- },
1931
- /**
1932
- * Returns all payee locations for a specified payee
1933
- * @summary List locations for a payee
1934
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1935
- * @param {string} payee_id - id of payee
1936
- * @param {*} [options] - Override http request options.
1937
- * @throws {RequiredError}
1938
- */
1939
- getPayeeLocationsByPayee(budget_id, payee_id, options = {}) {
1940
- // verify required parameter 'budget_id' is not null or undefined
1941
- if (budget_id === null || budget_id === undefined) {
1942
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getPayeeLocationsByPayee.');
1943
- }
1944
- // verify required parameter 'payee_id' is not null or undefined
1945
- if (payee_id === null || payee_id === undefined) {
1946
- throw new RequiredError('payee_id', 'Required parameter payee_id was null or undefined when calling getPayeeLocationsByPayee.');
1947
- }
1948
- const localVarPath = `/budgets/{budget_id}/payees/{payee_id}/payee_locations`
1949
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
1950
- .replace(`{${"payee_id"}}`, encodeURIComponent(String(payee_id)));
1951
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1952
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
1953
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1954
- const localVarHeaderParameter = {};
1955
- const localVarQueryParameter = {};
1956
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
1957
- localVarHeaderParameter["Accept"] = "application/json";
1958
- // authentication bearer required
1959
- if (configuration && configuration.apiKey) {
1960
- const localVarApiKeyValue = configuration.apiKey;
1961
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
1962
- }
1963
- const query = new URLSearchParams(localVarUrlObj.search);
1964
- for (const key in localVarQueryParameter) {
1965
- query.set(key, localVarQueryParameter[key]);
1966
- }
1967
- for (const key in options.query) {
1968
- query.set(key, options.query[key]);
1969
- }
1970
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
1971
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1972
- return {
1973
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
1974
- options: localVarRequestOptions,
1975
- };
1976
- },
1977
- };
1978
- };
1979
- exports.PayeeLocationsApiFetchParamCreator = PayeeLocationsApiFetchParamCreator;
1980
- /**
1981
- * PayeeLocationsApi - functional programming interface
1982
- * @export
1983
- */
1984
- const PayeeLocationsApiFp = function (configuration) {
1985
- return {
1986
- /**
1987
- * Returns a single payee location
1988
- * @summary Single payee location
1989
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
1990
- * @param {string} payee_location_id - id of payee location
1991
- * @param {*} [options] - Override http request options.
1992
- * @throws {RequiredError}
1993
- */
1994
- getPayeeLocationById(budget_id, payee_location_id, options) {
1995
- const localVarFetchArgs = (0, exports.PayeeLocationsApiFetchParamCreator)(configuration).getPayeeLocationById(budget_id, payee_location_id, options);
1996
- return (fetchFunction = fetch) => {
1997
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
1998
- if (response.status >= 200 && response.status < 300) {
1999
- const apiResponse = yield response.json();
2000
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2001
- return apiResponse;
2002
- }
2003
- else {
2004
- return response.json().then((e) => {
2005
- return Promise.reject(e);
2006
- });
2007
- }
2008
- }));
2009
- };
2010
- },
2011
- /**
2012
- * Returns all payee locations
2013
- * @summary List payee locations
2014
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2015
- * @param {*} [options] - Override http request options.
2016
- * @throws {RequiredError}
2017
- */
2018
- getPayeeLocations(budget_id, options) {
2019
- const localVarFetchArgs = (0, exports.PayeeLocationsApiFetchParamCreator)(configuration).getPayeeLocations(budget_id, options);
2020
- return (fetchFunction = fetch) => {
2021
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
2022
- if (response.status >= 200 && response.status < 300) {
2023
- const apiResponse = yield response.json();
2024
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2025
- return apiResponse;
2026
- }
2027
- else {
2028
- return response.json().then((e) => {
2029
- return Promise.reject(e);
2030
- });
2031
- }
2032
- }));
2033
- };
2034
- },
2035
- /**
2036
- * Returns all payee locations for a specified payee
2037
- * @summary List locations for a payee
2038
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2039
- * @param {string} payee_id - id of payee
2040
- * @param {*} [options] - Override http request options.
2041
- * @throws {RequiredError}
2042
- */
2043
- getPayeeLocationsByPayee(budget_id, payee_id, options) {
2044
- const localVarFetchArgs = (0, exports.PayeeLocationsApiFetchParamCreator)(configuration).getPayeeLocationsByPayee(budget_id, payee_id, options);
2045
- return (fetchFunction = fetch) => {
2046
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
2047
- if (response.status >= 200 && response.status < 300) {
2048
- const apiResponse = yield response.json();
2049
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2050
- return apiResponse;
2051
- }
2052
- else {
2053
- return response.json().then((e) => {
2054
- return Promise.reject(e);
2055
- });
2056
- }
2057
- }));
2058
- };
2059
- },
2060
- };
2061
- };
2062
- exports.PayeeLocationsApiFp = PayeeLocationsApiFp;
2063
- /**
2064
- * PayeeLocationsApi - factory interface
2065
- * @export
2066
- */
2067
- const PayeeLocationsApiFactory = function (configuration) {
2068
- return {
2069
- /**
2070
- * Returns a single payee location
2071
- * @summary Single payee location
2072
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2073
- * @param {string} payee_location_id - id of payee location
2074
- * @param {*} [options] - Override http request options.
2075
- * @throws {RequiredError}
2076
- */
2077
- getPayeeLocationById(budget_id, payee_location_id, options) {
2078
- return (0, exports.PayeeLocationsApiFp)(configuration).getPayeeLocationById(budget_id, payee_location_id, options)();
2079
- },
2080
- /**
2081
- * Returns all payee locations
2082
- * @summary List payee locations
2083
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2084
- * @param {*} [options] - Override http request options.
2085
- * @throws {RequiredError}
2086
- */
2087
- getPayeeLocations(budget_id, options) {
2088
- return (0, exports.PayeeLocationsApiFp)(configuration).getPayeeLocations(budget_id, options)();
2089
- },
2090
- /**
2091
- * Returns all payee locations for a specified payee
2092
- * @summary List locations for a payee
2093
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2094
- * @param {string} payee_id - id of payee
2095
- * @param {*} [options] - Override http request options.
2096
- * @throws {RequiredError}
2097
- */
2098
- getPayeeLocationsByPayee(budget_id, payee_id, options) {
2099
- return (0, exports.PayeeLocationsApiFp)(configuration).getPayeeLocationsByPayee(budget_id, payee_id, options)();
2100
- },
2101
- };
2102
- };
2103
- exports.PayeeLocationsApiFactory = PayeeLocationsApiFactory;
2104
- /**
2105
- * PayeeLocationsApi - object-oriented interface
2106
- * @export
2107
- * @class PayeeLocationsApi
2108
- * @extends {BaseAPI}
2109
- */
2110
- class PayeeLocationsApi extends BaseAPI {
2111
- /**
2112
- * Returns a single payee location
2113
- * @summary Single payee location
2114
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2115
- * @param {string} payee_location_id - id of payee location
2116
- * @param {*} [options] - Override http request options.
2117
- * @throws {RequiredError}
2118
- * @memberof PayeeLocationsApi
2119
- */
2120
- getPayeeLocationById(budget_id, payee_location_id, options) {
2121
- return (0, exports.PayeeLocationsApiFp)(this.configuration).getPayeeLocationById(budget_id, payee_location_id, options)();
2122
- }
2123
- /**
2124
- * Returns all payee locations
2125
- * @summary List payee locations
2126
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2127
- * @param {*} [options] - Override http request options.
2128
- * @throws {RequiredError}
2129
- * @memberof PayeeLocationsApi
2130
- */
2131
- getPayeeLocations(budget_id, options) {
2132
- return (0, exports.PayeeLocationsApiFp)(this.configuration).getPayeeLocations(budget_id, options)();
2133
- }
2134
- /**
2135
- * Returns all payee locations for a specified payee
2136
- * @summary List locations for a payee
2137
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2138
- * @param {string} payee_id - id of payee
2139
- * @param {*} [options] - Override http request options.
2140
- * @throws {RequiredError}
2141
- * @memberof PayeeLocationsApi
2142
- */
2143
- getPayeeLocationsByPayee(budget_id, payee_id, options) {
2144
- return (0, exports.PayeeLocationsApiFp)(this.configuration).getPayeeLocationsByPayee(budget_id, payee_id, options)();
2145
- }
2146
- }
2147
- exports.PayeeLocationsApi = PayeeLocationsApi;
2148
- /**
2149
- * PayeesApi - fetch parameter creator
2150
- * @export
2151
- */
2152
- const PayeesApiFetchParamCreator = function (configuration) {
2153
- return {
2154
- /**
2155
- * Returns a single payee
2156
- * @summary Single payee
2157
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2158
- * @param {string} payee_id - The id of the payee
2159
- * @param {*} [options] - Override http request options.
2160
- * @throws {RequiredError}
2161
- */
2162
- getPayeeById(budget_id, payee_id, options = {}) {
2163
- // verify required parameter 'budget_id' is not null or undefined
2164
- if (budget_id === null || budget_id === undefined) {
2165
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getPayeeById.');
2166
- }
2167
- // verify required parameter 'payee_id' is not null or undefined
2168
- if (payee_id === null || payee_id === undefined) {
2169
- throw new RequiredError('payee_id', 'Required parameter payee_id was null or undefined when calling getPayeeById.');
2170
- }
2171
- const localVarPath = `/budgets/{budget_id}/payees/{payee_id}`
2172
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2173
- .replace(`{${"payee_id"}}`, encodeURIComponent(String(payee_id)));
2174
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2175
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2176
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2177
- const localVarHeaderParameter = {};
2178
- const localVarQueryParameter = {};
2179
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2180
- localVarHeaderParameter["Accept"] = "application/json";
2181
- // authentication bearer required
2182
- if (configuration && configuration.apiKey) {
2183
- const localVarApiKeyValue = configuration.apiKey;
2184
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2185
- }
2186
- const query = new URLSearchParams(localVarUrlObj.search);
2187
- for (const key in localVarQueryParameter) {
2188
- query.set(key, localVarQueryParameter[key]);
2189
- }
2190
- for (const key in options.query) {
2191
- query.set(key, options.query[key]);
2192
- }
2193
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2194
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2195
- return {
2196
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2197
- options: localVarRequestOptions,
2198
- };
2199
- },
2200
- /**
2201
- * Returns all payees
2202
- * @summary List payees
2203
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2204
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2205
- * @param {*} [options] - Override http request options.
2206
- * @throws {RequiredError}
2207
- */
2208
- getPayees(budget_id, last_knowledge_of_server, options = {}) {
2209
- // verify required parameter 'budget_id' is not null or undefined
2210
- if (budget_id === null || budget_id === undefined) {
2211
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getPayees.');
2212
- }
2213
- const localVarPath = `/budgets/{budget_id}/payees`
2214
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
2215
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2216
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2217
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2218
- const localVarHeaderParameter = {};
2219
- const localVarQueryParameter = {};
2220
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2221
- localVarHeaderParameter["Accept"] = "application/json";
2222
- // authentication bearer required
2223
- if (configuration && configuration.apiKey) {
2224
- const localVarApiKeyValue = configuration.apiKey;
2225
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2226
- }
2227
- if (last_knowledge_of_server !== undefined) {
2228
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
2229
- }
2230
- const query = new URLSearchParams(localVarUrlObj.search);
2231
- for (const key in localVarQueryParameter) {
2232
- query.set(key, localVarQueryParameter[key]);
2233
- }
2234
- for (const key in options.query) {
2235
- query.set(key, options.query[key]);
2236
- }
2237
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2238
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2239
- return {
2240
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2241
- options: localVarRequestOptions,
2242
- };
2243
- },
2244
- };
2245
- };
2246
- exports.PayeesApiFetchParamCreator = PayeesApiFetchParamCreator;
2247
- /**
2248
- * PayeesApi - functional programming interface
2249
- * @export
2250
- */
2251
- const PayeesApiFp = function (configuration) {
2252
- return {
2253
- /**
2254
- * Returns a single payee
2255
- * @summary Single payee
2256
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2257
- * @param {string} payee_id - The id of the payee
2258
- * @param {*} [options] - Override http request options.
2259
- * @throws {RequiredError}
2260
- */
2261
- getPayeeById(budget_id, payee_id, options) {
2262
- const localVarFetchArgs = (0, exports.PayeesApiFetchParamCreator)(configuration).getPayeeById(budget_id, payee_id, options);
2263
- return (fetchFunction = fetch) => {
2264
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
2265
- if (response.status >= 200 && response.status < 300) {
2266
- const apiResponse = yield response.json();
2267
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2268
- return apiResponse;
2269
- }
2270
- else {
2271
- return response.json().then((e) => {
2272
- return Promise.reject(e);
2273
- });
2274
- }
2275
- }));
2276
- };
2277
- },
2278
- /**
2279
- * Returns all payees
2280
- * @summary List payees
2281
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2282
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2283
- * @param {*} [options] - Override http request options.
2284
- * @throws {RequiredError}
2285
- */
2286
- getPayees(budget_id, last_knowledge_of_server, options) {
2287
- const localVarFetchArgs = (0, exports.PayeesApiFetchParamCreator)(configuration).getPayees(budget_id, last_knowledge_of_server, options);
2288
- return (fetchFunction = fetch) => {
2289
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
2290
- if (response.status >= 200 && response.status < 300) {
2291
- const apiResponse = yield response.json();
2292
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2293
- return apiResponse;
2294
- }
2295
- else {
2296
- return response.json().then((e) => {
2297
- return Promise.reject(e);
2298
- });
2299
- }
2300
- }));
2301
- };
2302
- },
2303
- };
2304
- };
2305
- exports.PayeesApiFp = PayeesApiFp;
2306
- /**
2307
- * PayeesApi - factory interface
2308
- * @export
2309
- */
2310
- const PayeesApiFactory = function (configuration) {
2311
- return {
2312
- /**
2313
- * Returns a single payee
2314
- * @summary Single payee
2315
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2316
- * @param {string} payee_id - The id of the payee
2317
- * @param {*} [options] - Override http request options.
2318
- * @throws {RequiredError}
2319
- */
2320
- getPayeeById(budget_id, payee_id, options) {
2321
- return (0, exports.PayeesApiFp)(configuration).getPayeeById(budget_id, payee_id, options)();
2322
- },
2323
- /**
2324
- * Returns all payees
2325
- * @summary List payees
2326
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2327
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2328
- * @param {*} [options] - Override http request options.
2329
- * @throws {RequiredError}
2330
- */
2331
- getPayees(budget_id, last_knowledge_of_server, options) {
2332
- return (0, exports.PayeesApiFp)(configuration).getPayees(budget_id, last_knowledge_of_server, options)();
2333
- },
2334
- };
2335
- };
2336
- exports.PayeesApiFactory = PayeesApiFactory;
2337
- /**
2338
- * PayeesApi - object-oriented interface
2339
- * @export
2340
- * @class PayeesApi
2341
- * @extends {BaseAPI}
2342
- */
2343
- class PayeesApi extends BaseAPI {
2344
- /**
2345
- * Returns a single payee
2346
- * @summary Single payee
2347
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2348
- * @param {string} payee_id - The id of the payee
2349
- * @param {*} [options] - Override http request options.
2350
- * @throws {RequiredError}
2351
- * @memberof PayeesApi
2352
- */
2353
- getPayeeById(budget_id, payee_id, options) {
2354
- return (0, exports.PayeesApiFp)(this.configuration).getPayeeById(budget_id, payee_id, options)();
2355
- }
2356
- /**
2357
- * Returns all payees
2358
- * @summary List payees
2359
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2360
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2361
- * @param {*} [options] - Override http request options.
2362
- * @throws {RequiredError}
2363
- * @memberof PayeesApi
2364
- */
2365
- getPayees(budget_id, last_knowledge_of_server, options) {
2366
- return (0, exports.PayeesApiFp)(this.configuration).getPayees(budget_id, last_knowledge_of_server, options)();
2367
- }
2368
- }
2369
- exports.PayeesApi = PayeesApi;
2370
- /**
2371
- * ScheduledTransactionsApi - fetch parameter creator
2372
- * @export
2373
- */
2374
- const ScheduledTransactionsApiFetchParamCreator = function (configuration) {
2375
- return {
2376
- /**
2377
- * Returns a single scheduled transaction
2378
- * @summary Single scheduled transaction
2379
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2380
- * @param {string} scheduled_transaction_id - The id of the scheduled transaction
2381
- * @param {*} [options] - Override http request options.
2382
- * @throws {RequiredError}
2383
- */
2384
- getScheduledTransactionById(budget_id, scheduled_transaction_id, options = {}) {
2385
- // verify required parameter 'budget_id' is not null or undefined
2386
- if (budget_id === null || budget_id === undefined) {
2387
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getScheduledTransactionById.');
2388
- }
2389
- // verify required parameter 'scheduled_transaction_id' is not null or undefined
2390
- if (scheduled_transaction_id === null || scheduled_transaction_id === undefined) {
2391
- throw new RequiredError('scheduled_transaction_id', 'Required parameter scheduled_transaction_id was null or undefined when calling getScheduledTransactionById.');
2392
- }
2393
- const localVarPath = `/budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id}`
2394
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2395
- .replace(`{${"scheduled_transaction_id"}}`, encodeURIComponent(String(scheduled_transaction_id)));
2396
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2397
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2398
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2399
- const localVarHeaderParameter = {};
2400
- const localVarQueryParameter = {};
2401
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2402
- localVarHeaderParameter["Accept"] = "application/json";
2403
- // authentication bearer required
2404
- if (configuration && configuration.apiKey) {
2405
- const localVarApiKeyValue = configuration.apiKey;
2406
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2407
- }
2408
- const query = new URLSearchParams(localVarUrlObj.search);
2409
- for (const key in localVarQueryParameter) {
2410
- query.set(key, localVarQueryParameter[key]);
2411
- }
2412
- for (const key in options.query) {
2413
- query.set(key, options.query[key]);
2414
- }
2415
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2416
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2417
- return {
2418
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2419
- options: localVarRequestOptions,
2420
- };
2421
- },
2422
- /**
2423
- * Returns all scheduled transactions
2424
- * @summary List scheduled transactions
2425
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2426
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2427
- * @param {*} [options] - Override http request options.
2428
- * @throws {RequiredError}
2429
- */
2430
- getScheduledTransactions(budget_id, last_knowledge_of_server, options = {}) {
2431
- // verify required parameter 'budget_id' is not null or undefined
2432
- if (budget_id === null || budget_id === undefined) {
2433
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getScheduledTransactions.');
2434
- }
2435
- const localVarPath = `/budgets/{budget_id}/scheduled_transactions`
2436
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
2437
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2438
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2439
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2440
- const localVarHeaderParameter = {};
2441
- const localVarQueryParameter = {};
2442
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2443
- localVarHeaderParameter["Accept"] = "application/json";
2444
- // authentication bearer required
2445
- if (configuration && configuration.apiKey) {
2446
- const localVarApiKeyValue = configuration.apiKey;
2447
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2448
- }
2449
- if (last_knowledge_of_server !== undefined) {
2450
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
2451
- }
2452
- const query = new URLSearchParams(localVarUrlObj.search);
2453
- for (const key in localVarQueryParameter) {
2454
- query.set(key, localVarQueryParameter[key]);
2455
- }
2456
- for (const key in options.query) {
2457
- query.set(key, options.query[key]);
2458
- }
2459
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2460
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2461
- return {
2462
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2463
- options: localVarRequestOptions,
2464
- };
2465
- },
2466
- };
2467
- };
2468
- exports.ScheduledTransactionsApiFetchParamCreator = ScheduledTransactionsApiFetchParamCreator;
2469
- /**
2470
- * ScheduledTransactionsApi - functional programming interface
2471
- * @export
2472
- */
2473
- const ScheduledTransactionsApiFp = function (configuration) {
2474
- return {
2475
- /**
2476
- * Returns a single scheduled transaction
2477
- * @summary Single scheduled transaction
2478
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2479
- * @param {string} scheduled_transaction_id - The id of the scheduled transaction
2480
- * @param {*} [options] - Override http request options.
2481
- * @throws {RequiredError}
2482
- */
2483
- getScheduledTransactionById(budget_id, scheduled_transaction_id, options) {
2484
- const localVarFetchArgs = (0, exports.ScheduledTransactionsApiFetchParamCreator)(configuration).getScheduledTransactionById(budget_id, scheduled_transaction_id, options);
2485
- return (fetchFunction = fetch) => {
2486
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
2487
- if (response.status >= 200 && response.status < 300) {
2488
- const apiResponse = yield response.json();
2489
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2490
- return apiResponse;
2491
- }
2492
- else {
2493
- return response.json().then((e) => {
2494
- return Promise.reject(e);
2495
- });
2496
- }
2497
- }));
2498
- };
2499
- },
2500
- /**
2501
- * Returns all scheduled transactions
2502
- * @summary List scheduled transactions
2503
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2504
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2505
- * @param {*} [options] - Override http request options.
2506
- * @throws {RequiredError}
2507
- */
2508
- getScheduledTransactions(budget_id, last_knowledge_of_server, options) {
2509
- const localVarFetchArgs = (0, exports.ScheduledTransactionsApiFetchParamCreator)(configuration).getScheduledTransactions(budget_id, last_knowledge_of_server, options);
2510
- return (fetchFunction = fetch) => {
2511
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
2512
- if (response.status >= 200 && response.status < 300) {
2513
- const apiResponse = yield response.json();
2514
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2515
- return apiResponse;
2516
- }
2517
- else {
2518
- return response.json().then((e) => {
2519
- return Promise.reject(e);
2520
- });
2521
- }
2522
- }));
2523
- };
2524
- },
2525
- };
2526
- };
2527
- exports.ScheduledTransactionsApiFp = ScheduledTransactionsApiFp;
2528
- /**
2529
- * ScheduledTransactionsApi - factory interface
2530
- * @export
2531
- */
2532
- const ScheduledTransactionsApiFactory = function (configuration) {
2533
- return {
2534
- /**
2535
- * Returns a single scheduled transaction
2536
- * @summary Single scheduled transaction
2537
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2538
- * @param {string} scheduled_transaction_id - The id of the scheduled transaction
2539
- * @param {*} [options] - Override http request options.
2540
- * @throws {RequiredError}
2541
- */
2542
- getScheduledTransactionById(budget_id, scheduled_transaction_id, options) {
2543
- return (0, exports.ScheduledTransactionsApiFp)(configuration).getScheduledTransactionById(budget_id, scheduled_transaction_id, options)();
2544
- },
2545
- /**
2546
- * Returns all scheduled transactions
2547
- * @summary List scheduled transactions
2548
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2549
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2550
- * @param {*} [options] - Override http request options.
2551
- * @throws {RequiredError}
2552
- */
2553
- getScheduledTransactions(budget_id, last_knowledge_of_server, options) {
2554
- return (0, exports.ScheduledTransactionsApiFp)(configuration).getScheduledTransactions(budget_id, last_knowledge_of_server, options)();
2555
- },
2556
- };
2557
- };
2558
- exports.ScheduledTransactionsApiFactory = ScheduledTransactionsApiFactory;
2559
- /**
2560
- * ScheduledTransactionsApi - object-oriented interface
2561
- * @export
2562
- * @class ScheduledTransactionsApi
2563
- * @extends {BaseAPI}
2564
- */
2565
- class ScheduledTransactionsApi extends BaseAPI {
2566
- /**
2567
- * Returns a single scheduled transaction
2568
- * @summary Single scheduled transaction
2569
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2570
- * @param {string} scheduled_transaction_id - The id of the scheduled transaction
2571
- * @param {*} [options] - Override http request options.
2572
- * @throws {RequiredError}
2573
- * @memberof ScheduledTransactionsApi
2574
- */
2575
- getScheduledTransactionById(budget_id, scheduled_transaction_id, options) {
2576
- return (0, exports.ScheduledTransactionsApiFp)(this.configuration).getScheduledTransactionById(budget_id, scheduled_transaction_id, options)();
2577
- }
2578
- /**
2579
- * Returns all scheduled transactions
2580
- * @summary List scheduled transactions
2581
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2582
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2583
- * @param {*} [options] - Override http request options.
2584
- * @throws {RequiredError}
2585
- * @memberof ScheduledTransactionsApi
2586
- */
2587
- getScheduledTransactions(budget_id, last_knowledge_of_server, options) {
2588
- return (0, exports.ScheduledTransactionsApiFp)(this.configuration).getScheduledTransactions(budget_id, last_knowledge_of_server, options)();
2589
- }
2590
- }
2591
- exports.ScheduledTransactionsApi = ScheduledTransactionsApi;
2592
- /**
2593
- * TransactionsApi - fetch parameter creator
2594
- * @export
2595
- */
2596
- const TransactionsApiFetchParamCreator = function (configuration) {
2597
- return {
2598
- /**
2599
- * Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
2600
- * @summary Create a single transaction or multiple transactions
2601
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2602
- * @param {PostTransactionsWrapper} data - The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.
2603
- * @param {*} [options] - Override http request options.
2604
- * @throws {RequiredError}
2605
- */
2606
- createTransaction(budget_id, data, options = {}) {
2607
- // verify required parameter 'budget_id' is not null or undefined
2608
- if (budget_id === null || budget_id === undefined) {
2609
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling createTransaction.');
2610
- }
2611
- // verify required parameter 'data' is not null or undefined
2612
- if (data === null || data === undefined) {
2613
- throw new RequiredError('data', 'Required parameter data was null or undefined when calling createTransaction.');
2614
- }
2615
- const localVarPath = `/budgets/{budget_id}/transactions`
2616
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
2617
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2618
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2619
- const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
2620
- const localVarHeaderParameter = {};
2621
- const localVarQueryParameter = {};
2622
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2623
- localVarHeaderParameter["Accept"] = "application/json";
2624
- // authentication bearer required
2625
- if (configuration && configuration.apiKey) {
2626
- const localVarApiKeyValue = configuration.apiKey;
2627
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2628
- }
2629
- localVarHeaderParameter['Content-Type'] = 'application/json';
2630
- const query = new URLSearchParams(localVarUrlObj.search);
2631
- for (const key in localVarQueryParameter) {
2632
- query.set(key, localVarQueryParameter[key]);
2633
- }
2634
- for (const key in options.query) {
2635
- query.set(key, options.query[key]);
2636
- }
2637
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2638
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2639
- localVarRequestOptions.body = JSON.stringify(data || {});
2640
- return {
2641
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2642
- options: localVarRequestOptions,
2643
- };
2644
- },
2645
- /**
2646
- * Deletes a transaction
2647
- * @summary Deletes an existing transaction
2648
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2649
- * @param {string} transaction_id - The id of the transaction
2650
- * @param {*} [options] - Override http request options.
2651
- * @throws {RequiredError}
2652
- */
2653
- deleteTransaction(budget_id, transaction_id, options = {}) {
2654
- // verify required parameter 'budget_id' is not null or undefined
2655
- if (budget_id === null || budget_id === undefined) {
2656
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling deleteTransaction.');
2657
- }
2658
- // verify required parameter 'transaction_id' is not null or undefined
2659
- if (transaction_id === null || transaction_id === undefined) {
2660
- throw new RequiredError('transaction_id', 'Required parameter transaction_id was null or undefined when calling deleteTransaction.');
2661
- }
2662
- const localVarPath = `/budgets/{budget_id}/transactions/{transaction_id}`
2663
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2664
- .replace(`{${"transaction_id"}}`, encodeURIComponent(String(transaction_id)));
2665
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2666
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2667
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
2668
- const localVarHeaderParameter = {};
2669
- const localVarQueryParameter = {};
2670
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2671
- localVarHeaderParameter["Accept"] = "application/json";
2672
- // authentication bearer required
2673
- if (configuration && configuration.apiKey) {
2674
- const localVarApiKeyValue = configuration.apiKey;
2675
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2676
- }
2677
- const query = new URLSearchParams(localVarUrlObj.search);
2678
- for (const key in localVarQueryParameter) {
2679
- query.set(key, localVarQueryParameter[key]);
2680
- }
2681
- for (const key in options.query) {
2682
- query.set(key, options.query[key]);
2683
- }
2684
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2685
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2686
- return {
2687
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2688
- options: localVarRequestOptions,
2689
- };
2690
- },
2691
- /**
2692
- * Returns a single transaction
2693
- * @summary Single transaction
2694
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2695
- * @param {string} transaction_id - The id of the transaction
2696
- * @param {*} [options] - Override http request options.
2697
- * @throws {RequiredError}
2698
- */
2699
- getTransactionById(budget_id, transaction_id, options = {}) {
2700
- // verify required parameter 'budget_id' is not null or undefined
2701
- if (budget_id === null || budget_id === undefined) {
2702
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getTransactionById.');
2703
- }
2704
- // verify required parameter 'transaction_id' is not null or undefined
2705
- if (transaction_id === null || transaction_id === undefined) {
2706
- throw new RequiredError('transaction_id', 'Required parameter transaction_id was null or undefined when calling getTransactionById.');
2707
- }
2708
- const localVarPath = `/budgets/{budget_id}/transactions/{transaction_id}`
2709
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2710
- .replace(`{${"transaction_id"}}`, encodeURIComponent(String(transaction_id)));
2711
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2712
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2713
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2714
- const localVarHeaderParameter = {};
2715
- const localVarQueryParameter = {};
2716
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2717
- localVarHeaderParameter["Accept"] = "application/json";
2718
- // authentication bearer required
2719
- if (configuration && configuration.apiKey) {
2720
- const localVarApiKeyValue = configuration.apiKey;
2721
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2722
- }
2723
- const query = new URLSearchParams(localVarUrlObj.search);
2724
- for (const key in localVarQueryParameter) {
2725
- query.set(key, localVarQueryParameter[key]);
2726
- }
2727
- for (const key in options.query) {
2728
- query.set(key, options.query[key]);
2729
- }
2730
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2731
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2732
- return {
2733
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2734
- options: localVarRequestOptions,
2735
- };
2736
- },
2737
- /**
2738
- * Returns budget transactions
2739
- * @summary List transactions
2740
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2741
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
2742
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
2743
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2744
- * @param {*} [options] - Override http request options.
2745
- * @throws {RequiredError}
2746
- */
2747
- getTransactions(budget_id, since_date, type, last_knowledge_of_server, options = {}) {
2748
- // verify required parameter 'budget_id' is not null or undefined
2749
- if (budget_id === null || budget_id === undefined) {
2750
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getTransactions.');
2751
- }
2752
- const localVarPath = `/budgets/{budget_id}/transactions`
2753
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
2754
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2755
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2756
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2757
- const localVarHeaderParameter = {};
2758
- const localVarQueryParameter = {};
2759
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2760
- localVarHeaderParameter["Accept"] = "application/json";
2761
- // authentication bearer required
2762
- if (configuration && configuration.apiKey) {
2763
- const localVarApiKeyValue = configuration.apiKey;
2764
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2765
- }
2766
- if (since_date !== undefined) {
2767
- localVarQueryParameter['since_date'] = convertDateToFullDateStringFormat(since_date);
2768
- }
2769
- if (type !== undefined) {
2770
- localVarQueryParameter['type'] = type;
2771
- }
2772
- if (last_knowledge_of_server !== undefined) {
2773
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
2774
- }
2775
- const query = new URLSearchParams(localVarUrlObj.search);
2776
- for (const key in localVarQueryParameter) {
2777
- query.set(key, localVarQueryParameter[key]);
2778
- }
2779
- for (const key in options.query) {
2780
- query.set(key, options.query[key]);
2781
- }
2782
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2783
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2784
- return {
2785
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2786
- options: localVarRequestOptions,
2787
- };
2788
- },
2789
- /**
2790
- * Returns all transactions for a specified account
2791
- * @summary List account transactions
2792
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2793
- * @param {string} account_id - The id of the account
2794
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
2795
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
2796
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2797
- * @param {*} [options] - Override http request options.
2798
- * @throws {RequiredError}
2799
- */
2800
- getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options = {}) {
2801
- // verify required parameter 'budget_id' is not null or undefined
2802
- if (budget_id === null || budget_id === undefined) {
2803
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getTransactionsByAccount.');
2804
- }
2805
- // verify required parameter 'account_id' is not null or undefined
2806
- if (account_id === null || account_id === undefined) {
2807
- throw new RequiredError('account_id', 'Required parameter account_id was null or undefined when calling getTransactionsByAccount.');
2808
- }
2809
- const localVarPath = `/budgets/{budget_id}/accounts/{account_id}/transactions`
2810
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2811
- .replace(`{${"account_id"}}`, encodeURIComponent(String(account_id)));
2812
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2813
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2814
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2815
- const localVarHeaderParameter = {};
2816
- const localVarQueryParameter = {};
2817
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2818
- localVarHeaderParameter["Accept"] = "application/json";
2819
- // authentication bearer required
2820
- if (configuration && configuration.apiKey) {
2821
- const localVarApiKeyValue = configuration.apiKey;
2822
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2823
- }
2824
- if (since_date !== undefined) {
2825
- localVarQueryParameter['since_date'] = convertDateToFullDateStringFormat(since_date);
2826
- }
2827
- if (type !== undefined) {
2828
- localVarQueryParameter['type'] = type;
2829
- }
2830
- if (last_knowledge_of_server !== undefined) {
2831
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
2832
- }
2833
- const query = new URLSearchParams(localVarUrlObj.search);
2834
- for (const key in localVarQueryParameter) {
2835
- query.set(key, localVarQueryParameter[key]);
2836
- }
2837
- for (const key in options.query) {
2838
- query.set(key, options.query[key]);
2839
- }
2840
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2841
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2842
- return {
2843
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2844
- options: localVarRequestOptions,
2845
- };
2846
- },
2847
- /**
2848
- * Returns all transactions for a specified category
2849
- * @summary List category transactions
2850
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2851
- * @param {string} category_id - The id of the category
2852
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
2853
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
2854
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2855
- * @param {*} [options] - Override http request options.
2856
- * @throws {RequiredError}
2857
- */
2858
- getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options = {}) {
2859
- // verify required parameter 'budget_id' is not null or undefined
2860
- if (budget_id === null || budget_id === undefined) {
2861
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getTransactionsByCategory.');
2862
- }
2863
- // verify required parameter 'category_id' is not null or undefined
2864
- if (category_id === null || category_id === undefined) {
2865
- throw new RequiredError('category_id', 'Required parameter category_id was null or undefined when calling getTransactionsByCategory.');
2866
- }
2867
- const localVarPath = `/budgets/{budget_id}/categories/{category_id}/transactions`
2868
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2869
- .replace(`{${"category_id"}}`, encodeURIComponent(String(category_id)));
2870
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2871
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2872
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2873
- const localVarHeaderParameter = {};
2874
- const localVarQueryParameter = {};
2875
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2876
- localVarHeaderParameter["Accept"] = "application/json";
2877
- // authentication bearer required
2878
- if (configuration && configuration.apiKey) {
2879
- const localVarApiKeyValue = configuration.apiKey;
2880
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2881
- }
2882
- if (since_date !== undefined) {
2883
- localVarQueryParameter['since_date'] = convertDateToFullDateStringFormat(since_date);
2884
- }
2885
- if (type !== undefined) {
2886
- localVarQueryParameter['type'] = type;
2887
- }
2888
- if (last_knowledge_of_server !== undefined) {
2889
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
2890
- }
2891
- const query = new URLSearchParams(localVarUrlObj.search);
2892
- for (const key in localVarQueryParameter) {
2893
- query.set(key, localVarQueryParameter[key]);
2894
- }
2895
- for (const key in options.query) {
2896
- query.set(key, options.query[key]);
2897
- }
2898
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2899
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2900
- return {
2901
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2902
- options: localVarRequestOptions,
2903
- };
2904
- },
2905
- /**
2906
- * Returns all transactions for a specified payee
2907
- * @summary List payee transactions
2908
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2909
- * @param {string} payee_id - The id of the payee
2910
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
2911
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
2912
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
2913
- * @param {*} [options] - Override http request options.
2914
- * @throws {RequiredError}
2915
- */
2916
- getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options = {}) {
2917
- // verify required parameter 'budget_id' is not null or undefined
2918
- if (budget_id === null || budget_id === undefined) {
2919
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling getTransactionsByPayee.');
2920
- }
2921
- // verify required parameter 'payee_id' is not null or undefined
2922
- if (payee_id === null || payee_id === undefined) {
2923
- throw new RequiredError('payee_id', 'Required parameter payee_id was null or undefined when calling getTransactionsByPayee.');
2924
- }
2925
- const localVarPath = `/budgets/{budget_id}/payees/{payee_id}/transactions`
2926
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
2927
- .replace(`{${"payee_id"}}`, encodeURIComponent(String(payee_id)));
2928
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2929
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2930
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2931
- const localVarHeaderParameter = {};
2932
- const localVarQueryParameter = {};
2933
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2934
- localVarHeaderParameter["Accept"] = "application/json";
2935
- // authentication bearer required
2936
- if (configuration && configuration.apiKey) {
2937
- const localVarApiKeyValue = configuration.apiKey;
2938
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2939
- }
2940
- if (since_date !== undefined) {
2941
- localVarQueryParameter['since_date'] = convertDateToFullDateStringFormat(since_date);
2942
- }
2943
- if (type !== undefined) {
2944
- localVarQueryParameter['type'] = type;
2945
- }
2946
- if (last_knowledge_of_server !== undefined) {
2947
- localVarQueryParameter['last_knowledge_of_server'] = last_knowledge_of_server;
2948
- }
2949
- const query = new URLSearchParams(localVarUrlObj.search);
2950
- for (const key in localVarQueryParameter) {
2951
- query.set(key, localVarQueryParameter[key]);
2952
- }
2953
- for (const key in options.query) {
2954
- query.set(key, options.query[key]);
2955
- }
2956
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2957
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2958
- return {
2959
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
2960
- options: localVarRequestOptions,
2961
- };
2962
- },
2963
- /**
2964
- * Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
2965
- * @summary Import transactions
2966
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
2967
- * @param {*} [options] - Override http request options.
2968
- * @throws {RequiredError}
2969
- */
2970
- importTransactions(budget_id, options = {}) {
2971
- // verify required parameter 'budget_id' is not null or undefined
2972
- if (budget_id === null || budget_id === undefined) {
2973
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling importTransactions.');
2974
- }
2975
- const localVarPath = `/budgets/{budget_id}/transactions/import`
2976
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
2977
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2978
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
2979
- const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
2980
- const localVarHeaderParameter = {};
2981
- const localVarQueryParameter = {};
2982
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
2983
- localVarHeaderParameter["Accept"] = "application/json";
2984
- // authentication bearer required
2985
- if (configuration && configuration.apiKey) {
2986
- const localVarApiKeyValue = configuration.apiKey;
2987
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
2988
- }
2989
- const query = new URLSearchParams(localVarUrlObj.search);
2990
- for (const key in localVarQueryParameter) {
2991
- query.set(key, localVarQueryParameter[key]);
2992
- }
2993
- for (const key in options.query) {
2994
- query.set(key, options.query[key]);
2995
- }
2996
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
2997
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2998
- return {
2999
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
3000
- options: localVarRequestOptions,
3001
- };
3002
- },
3003
- /**
3004
- * Updates a single transaction
3005
- * @summary Updates an existing transaction
3006
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3007
- * @param {string} transaction_id - The id of the transaction
3008
- * @param {PutTransactionWrapper} data - The transaction to update
3009
- * @param {*} [options] - Override http request options.
3010
- * @throws {RequiredError}
3011
- */
3012
- updateTransaction(budget_id, transaction_id, data, options = {}) {
3013
- // verify required parameter 'budget_id' is not null or undefined
3014
- if (budget_id === null || budget_id === undefined) {
3015
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling updateTransaction.');
3016
- }
3017
- // verify required parameter 'transaction_id' is not null or undefined
3018
- if (transaction_id === null || transaction_id === undefined) {
3019
- throw new RequiredError('transaction_id', 'Required parameter transaction_id was null or undefined when calling updateTransaction.');
3020
- }
3021
- // verify required parameter 'data' is not null or undefined
3022
- if (data === null || data === undefined) {
3023
- throw new RequiredError('data', 'Required parameter data was null or undefined when calling updateTransaction.');
3024
- }
3025
- const localVarPath = `/budgets/{budget_id}/transactions/{transaction_id}`
3026
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)))
3027
- .replace(`{${"transaction_id"}}`, encodeURIComponent(String(transaction_id)));
3028
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
3029
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
3030
- const localVarRequestOptions = Object.assign({ method: 'PUT' }, options);
3031
- const localVarHeaderParameter = {};
3032
- const localVarQueryParameter = {};
3033
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
3034
- localVarHeaderParameter["Accept"] = "application/json";
3035
- // authentication bearer required
3036
- if (configuration && configuration.apiKey) {
3037
- const localVarApiKeyValue = configuration.apiKey;
3038
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
3039
- }
3040
- localVarHeaderParameter['Content-Type'] = 'application/json';
3041
- const query = new URLSearchParams(localVarUrlObj.search);
3042
- for (const key in localVarQueryParameter) {
3043
- query.set(key, localVarQueryParameter[key]);
3044
- }
3045
- for (const key in options.query) {
3046
- query.set(key, options.query[key]);
3047
- }
3048
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
3049
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
3050
- localVarRequestOptions.body = JSON.stringify(data || {});
3051
- return {
3052
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
3053
- options: localVarRequestOptions,
3054
- };
3055
- },
3056
- /**
3057
- * Updates multiple transactions, by `id` or `import_id`.
3058
- * @summary Update multiple transactions
3059
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3060
- * @param {PatchTransactionsWrapper} data - The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup.
3061
- * @param {*} [options] - Override http request options.
3062
- * @throws {RequiredError}
3063
- */
3064
- updateTransactions(budget_id, data, options = {}) {
3065
- // verify required parameter 'budget_id' is not null or undefined
3066
- if (budget_id === null || budget_id === undefined) {
3067
- throw new RequiredError('budget_id', 'Required parameter budget_id was null or undefined when calling updateTransactions.');
3068
- }
3069
- // verify required parameter 'data' is not null or undefined
3070
- if (data === null || data === undefined) {
3071
- throw new RequiredError('data', 'Required parameter data was null or undefined when calling updateTransactions.');
3072
- }
3073
- const localVarPath = `/budgets/{budget_id}/transactions`
3074
- .replace(`{${"budget_id"}}`, encodeURIComponent(String(budget_id)));
3075
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
3076
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
3077
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, options);
3078
- const localVarHeaderParameter = {};
3079
- const localVarQueryParameter = {};
3080
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
3081
- localVarHeaderParameter["Accept"] = "application/json";
3082
- // authentication bearer required
3083
- if (configuration && configuration.apiKey) {
3084
- const localVarApiKeyValue = configuration.apiKey;
3085
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
3086
- }
3087
- localVarHeaderParameter['Content-Type'] = 'application/json';
3088
- const query = new URLSearchParams(localVarUrlObj.search);
3089
- for (const key in localVarQueryParameter) {
3090
- query.set(key, localVarQueryParameter[key]);
3091
- }
3092
- for (const key in options.query) {
3093
- query.set(key, options.query[key]);
3094
- }
3095
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
3096
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
3097
- localVarRequestOptions.body = JSON.stringify(data || {});
3098
- return {
3099
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
3100
- options: localVarRequestOptions,
3101
- };
3102
- },
3103
- };
3104
- };
3105
- exports.TransactionsApiFetchParamCreator = TransactionsApiFetchParamCreator;
3106
- /**
3107
- * TransactionsApi - functional programming interface
3108
- * @export
3109
- */
3110
- const TransactionsApiFp = function (configuration) {
3111
- return {
3112
- /**
3113
- * Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
3114
- * @summary Create a single transaction or multiple transactions
3115
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3116
- * @param {PostTransactionsWrapper} data - The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.
3117
- * @param {*} [options] - Override http request options.
3118
- * @throws {RequiredError}
3119
- */
3120
- createTransaction(budget_id, data, options) {
3121
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).createTransaction(budget_id, data, options);
3122
- return (fetchFunction = fetch) => {
3123
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3124
- if (response.status >= 200 && response.status < 300) {
3125
- const apiResponse = yield response.json();
3126
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3127
- return apiResponse;
3128
- }
3129
- else {
3130
- return response.json().then((e) => {
3131
- return Promise.reject(e);
3132
- });
3133
- }
3134
- }));
3135
- };
3136
- },
3137
- /**
3138
- * Deletes a transaction
3139
- * @summary Deletes an existing transaction
3140
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3141
- * @param {string} transaction_id - The id of the transaction
3142
- * @param {*} [options] - Override http request options.
3143
- * @throws {RequiredError}
3144
- */
3145
- deleteTransaction(budget_id, transaction_id, options) {
3146
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).deleteTransaction(budget_id, transaction_id, options);
3147
- return (fetchFunction = fetch) => {
3148
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3149
- if (response.status >= 200 && response.status < 300) {
3150
- const apiResponse = yield response.json();
3151
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3152
- return apiResponse;
3153
- }
3154
- else {
3155
- return response.json().then((e) => {
3156
- return Promise.reject(e);
3157
- });
3158
- }
3159
- }));
3160
- };
3161
- },
3162
- /**
3163
- * Returns a single transaction
3164
- * @summary Single transaction
3165
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3166
- * @param {string} transaction_id - The id of the transaction
3167
- * @param {*} [options] - Override http request options.
3168
- * @throws {RequiredError}
3169
- */
3170
- getTransactionById(budget_id, transaction_id, options) {
3171
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).getTransactionById(budget_id, transaction_id, options);
3172
- return (fetchFunction = fetch) => {
3173
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3174
- if (response.status >= 200 && response.status < 300) {
3175
- const apiResponse = yield response.json();
3176
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3177
- return apiResponse;
3178
- }
3179
- else {
3180
- return response.json().then((e) => {
3181
- return Promise.reject(e);
3182
- });
3183
- }
3184
- }));
3185
- };
3186
- },
3187
- /**
3188
- * Returns budget transactions
3189
- * @summary List transactions
3190
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3191
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3192
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3193
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3194
- * @param {*} [options] - Override http request options.
3195
- * @throws {RequiredError}
3196
- */
3197
- getTransactions(budget_id, since_date, type, last_knowledge_of_server, options) {
3198
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).getTransactions(budget_id, since_date, type, last_knowledge_of_server, options);
3199
- return (fetchFunction = fetch) => {
3200
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3201
- if (response.status >= 200 && response.status < 300) {
3202
- const apiResponse = yield response.json();
3203
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3204
- return apiResponse;
3205
- }
3206
- else {
3207
- return response.json().then((e) => {
3208
- return Promise.reject(e);
3209
- });
3210
- }
3211
- }));
3212
- };
3213
- },
3214
- /**
3215
- * Returns all transactions for a specified account
3216
- * @summary List account transactions
3217
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3218
- * @param {string} account_id - The id of the account
3219
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3220
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3221
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3222
- * @param {*} [options] - Override http request options.
3223
- * @throws {RequiredError}
3224
- */
3225
- getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options) {
3226
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options);
3227
- return (fetchFunction = fetch) => {
3228
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3229
- if (response.status >= 200 && response.status < 300) {
3230
- const apiResponse = yield response.json();
3231
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3232
- return apiResponse;
3233
- }
3234
- else {
3235
- return response.json().then((e) => {
3236
- return Promise.reject(e);
3237
- });
3238
- }
3239
- }));
3240
- };
3241
- },
3242
- /**
3243
- * Returns all transactions for a specified category
3244
- * @summary List category transactions
3245
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3246
- * @param {string} category_id - The id of the category
3247
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3248
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3249
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3250
- * @param {*} [options] - Override http request options.
3251
- * @throws {RequiredError}
3252
- */
3253
- getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options) {
3254
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options);
3255
- return (fetchFunction = fetch) => {
3256
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3257
- if (response.status >= 200 && response.status < 300) {
3258
- const apiResponse = yield response.json();
3259
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3260
- return apiResponse;
3261
- }
3262
- else {
3263
- return response.json().then((e) => {
3264
- return Promise.reject(e);
3265
- });
3266
- }
3267
- }));
3268
- };
3269
- },
3270
- /**
3271
- * Returns all transactions for a specified payee
3272
- * @summary List payee transactions
3273
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3274
- * @param {string} payee_id - The id of the payee
3275
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3276
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3277
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3278
- * @param {*} [options] - Override http request options.
3279
- * @throws {RequiredError}
3280
- */
3281
- getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options) {
3282
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options);
3283
- return (fetchFunction = fetch) => {
3284
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3285
- if (response.status >= 200 && response.status < 300) {
3286
- const apiResponse = yield response.json();
3287
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3288
- return apiResponse;
3289
- }
3290
- else {
3291
- return response.json().then((e) => {
3292
- return Promise.reject(e);
3293
- });
3294
- }
3295
- }));
3296
- };
3297
- },
3298
- /**
3299
- * Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
3300
- * @summary Import transactions
3301
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3302
- * @param {*} [options] - Override http request options.
3303
- * @throws {RequiredError}
3304
- */
3305
- importTransactions(budget_id, options) {
3306
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).importTransactions(budget_id, options);
3307
- return (fetchFunction = fetch) => {
3308
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3309
- if (response.status >= 200 && response.status < 300) {
3310
- const apiResponse = yield response.json();
3311
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3312
- return apiResponse;
3313
- }
3314
- else {
3315
- return response.json().then((e) => {
3316
- return Promise.reject(e);
3317
- });
3318
- }
3319
- }));
3320
- };
3321
- },
3322
- /**
3323
- * Updates a single transaction
3324
- * @summary Updates an existing transaction
3325
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3326
- * @param {string} transaction_id - The id of the transaction
3327
- * @param {PutTransactionWrapper} data - The transaction to update
3328
- * @param {*} [options] - Override http request options.
3329
- * @throws {RequiredError}
3330
- */
3331
- updateTransaction(budget_id, transaction_id, data, options) {
3332
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).updateTransaction(budget_id, transaction_id, data, options);
3333
- return (fetchFunction = fetch) => {
3334
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3335
- if (response.status >= 200 && response.status < 300) {
3336
- const apiResponse = yield response.json();
3337
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3338
- return apiResponse;
3339
- }
3340
- else {
3341
- return response.json().then((e) => {
3342
- return Promise.reject(e);
3343
- });
3344
- }
3345
- }));
3346
- };
3347
- },
3348
- /**
3349
- * Updates multiple transactions, by `id` or `import_id`.
3350
- * @summary Update multiple transactions
3351
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3352
- * @param {PatchTransactionsWrapper} data - The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup.
3353
- * @param {*} [options] - Override http request options.
3354
- * @throws {RequiredError}
3355
- */
3356
- updateTransactions(budget_id, data, options) {
3357
- const localVarFetchArgs = (0, exports.TransactionsApiFetchParamCreator)(configuration).updateTransactions(budget_id, data, options);
3358
- return (fetchFunction = fetch) => {
3359
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3360
- if (response.status >= 200 && response.status < 300) {
3361
- const apiResponse = yield response.json();
3362
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3363
- return apiResponse;
3364
- }
3365
- else {
3366
- return response.json().then((e) => {
3367
- return Promise.reject(e);
3368
- });
3369
- }
3370
- }));
3371
- };
3372
- },
3373
- };
3374
- };
3375
- exports.TransactionsApiFp = TransactionsApiFp;
3376
- /**
3377
- * TransactionsApi - factory interface
3378
- * @export
3379
- */
3380
- const TransactionsApiFactory = function (configuration) {
3381
- return {
3382
- /**
3383
- * Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
3384
- * @summary Create a single transaction or multiple transactions
3385
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3386
- * @param {PostTransactionsWrapper} data - The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.
3387
- * @param {*} [options] - Override http request options.
3388
- * @throws {RequiredError}
3389
- */
3390
- createTransaction(budget_id, data, options) {
3391
- return (0, exports.TransactionsApiFp)(configuration).createTransaction(budget_id, data, options)();
3392
- },
3393
- /**
3394
- * Deletes a transaction
3395
- * @summary Deletes an existing transaction
3396
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3397
- * @param {string} transaction_id - The id of the transaction
3398
- * @param {*} [options] - Override http request options.
3399
- * @throws {RequiredError}
3400
- */
3401
- deleteTransaction(budget_id, transaction_id, options) {
3402
- return (0, exports.TransactionsApiFp)(configuration).deleteTransaction(budget_id, transaction_id, options)();
3403
- },
3404
- /**
3405
- * Returns a single transaction
3406
- * @summary Single transaction
3407
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3408
- * @param {string} transaction_id - The id of the transaction
3409
- * @param {*} [options] - Override http request options.
3410
- * @throws {RequiredError}
3411
- */
3412
- getTransactionById(budget_id, transaction_id, options) {
3413
- return (0, exports.TransactionsApiFp)(configuration).getTransactionById(budget_id, transaction_id, options)();
3414
- },
3415
- /**
3416
- * Returns budget transactions
3417
- * @summary List transactions
3418
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3419
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3420
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3421
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3422
- * @param {*} [options] - Override http request options.
3423
- * @throws {RequiredError}
3424
- */
3425
- getTransactions(budget_id, since_date, type, last_knowledge_of_server, options) {
3426
- return (0, exports.TransactionsApiFp)(configuration).getTransactions(budget_id, since_date, type, last_knowledge_of_server, options)();
3427
- },
3428
- /**
3429
- * Returns all transactions for a specified account
3430
- * @summary List account transactions
3431
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3432
- * @param {string} account_id - The id of the account
3433
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3434
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3435
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3436
- * @param {*} [options] - Override http request options.
3437
- * @throws {RequiredError}
3438
- */
3439
- getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options) {
3440
- return (0, exports.TransactionsApiFp)(configuration).getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options)();
3441
- },
3442
- /**
3443
- * Returns all transactions for a specified category
3444
- * @summary List category transactions
3445
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3446
- * @param {string} category_id - The id of the category
3447
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3448
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3449
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3450
- * @param {*} [options] - Override http request options.
3451
- * @throws {RequiredError}
3452
- */
3453
- getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options) {
3454
- return (0, exports.TransactionsApiFp)(configuration).getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options)();
3455
- },
3456
- /**
3457
- * Returns all transactions for a specified payee
3458
- * @summary List payee transactions
3459
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3460
- * @param {string} payee_id - The id of the payee
3461
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3462
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3463
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3464
- * @param {*} [options] - Override http request options.
3465
- * @throws {RequiredError}
3466
- */
3467
- getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options) {
3468
- return (0, exports.TransactionsApiFp)(configuration).getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options)();
3469
- },
3470
- /**
3471
- * Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
3472
- * @summary Import transactions
3473
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3474
- * @param {*} [options] - Override http request options.
3475
- * @throws {RequiredError}
3476
- */
3477
- importTransactions(budget_id, options) {
3478
- return (0, exports.TransactionsApiFp)(configuration).importTransactions(budget_id, options)();
3479
- },
3480
- /**
3481
- * Updates a single transaction
3482
- * @summary Updates an existing transaction
3483
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3484
- * @param {string} transaction_id - The id of the transaction
3485
- * @param {PutTransactionWrapper} data - The transaction to update
3486
- * @param {*} [options] - Override http request options.
3487
- * @throws {RequiredError}
3488
- */
3489
- updateTransaction(budget_id, transaction_id, data, options) {
3490
- return (0, exports.TransactionsApiFp)(configuration).updateTransaction(budget_id, transaction_id, data, options)();
3491
- },
3492
- /**
3493
- * Updates multiple transactions, by `id` or `import_id`.
3494
- * @summary Update multiple transactions
3495
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3496
- * @param {PatchTransactionsWrapper} data - The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup.
3497
- * @param {*} [options] - Override http request options.
3498
- * @throws {RequiredError}
3499
- */
3500
- updateTransactions(budget_id, data, options) {
3501
- return (0, exports.TransactionsApiFp)(configuration).updateTransactions(budget_id, data, options)();
3502
- },
3503
- };
3504
- };
3505
- exports.TransactionsApiFactory = TransactionsApiFactory;
3506
- /**
3507
- * TransactionsApi - object-oriented interface
3508
- * @export
3509
- * @class TransactionsApi
3510
- * @extends {BaseAPI}
3511
- */
3512
- class TransactionsApi extends BaseAPI {
3513
- /**
3514
- * Creates a single transaction or multiple transactions. If you provide a body containing a `transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions cannot be created on this endpoint.
3515
- * @summary Create a single transaction or multiple transactions
3516
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3517
- * @param {PostTransactionsWrapper} data - The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.
3518
- * @param {*} [options] - Override http request options.
3519
- * @throws {RequiredError}
3520
- * @memberof TransactionsApi
3521
- */
3522
- createTransaction(budget_id, data, options) {
3523
- return (0, exports.TransactionsApiFp)(this.configuration).createTransaction(budget_id, data, options)();
3524
- }
3525
- /**
3526
- * Deletes a transaction
3527
- * @summary Deletes an existing transaction
3528
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3529
- * @param {string} transaction_id - The id of the transaction
3530
- * @param {*} [options] - Override http request options.
3531
- * @throws {RequiredError}
3532
- * @memberof TransactionsApi
3533
- */
3534
- deleteTransaction(budget_id, transaction_id, options) {
3535
- return (0, exports.TransactionsApiFp)(this.configuration).deleteTransaction(budget_id, transaction_id, options)();
3536
- }
3537
- /**
3538
- * Returns a single transaction
3539
- * @summary Single transaction
3540
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3541
- * @param {string} transaction_id - The id of the transaction
3542
- * @param {*} [options] - Override http request options.
3543
- * @throws {RequiredError}
3544
- * @memberof TransactionsApi
3545
- */
3546
- getTransactionById(budget_id, transaction_id, options) {
3547
- return (0, exports.TransactionsApiFp)(this.configuration).getTransactionById(budget_id, transaction_id, options)();
3548
- }
3549
- /**
3550
- * Returns budget transactions
3551
- * @summary List transactions
3552
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3553
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3554
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3555
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3556
- * @param {*} [options] - Override http request options.
3557
- * @throws {RequiredError}
3558
- * @memberof TransactionsApi
3559
- */
3560
- getTransactions(budget_id, since_date, type, last_knowledge_of_server, options) {
3561
- return (0, exports.TransactionsApiFp)(this.configuration).getTransactions(budget_id, since_date, type, last_knowledge_of_server, options)();
3562
- }
3563
- /**
3564
- * Returns all transactions for a specified account
3565
- * @summary List account transactions
3566
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3567
- * @param {string} account_id - The id of the account
3568
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3569
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3570
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3571
- * @param {*} [options] - Override http request options.
3572
- * @throws {RequiredError}
3573
- * @memberof TransactionsApi
3574
- */
3575
- getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options) {
3576
- return (0, exports.TransactionsApiFp)(this.configuration).getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options)();
3577
- }
3578
- /**
3579
- * Returns all transactions for a specified category
3580
- * @summary List category transactions
3581
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3582
- * @param {string} category_id - The id of the category
3583
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3584
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3585
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3586
- * @param {*} [options] - Override http request options.
3587
- * @throws {RequiredError}
3588
- * @memberof TransactionsApi
3589
- */
3590
- getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options) {
3591
- return (0, exports.TransactionsApiFp)(this.configuration).getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options)();
3592
- }
3593
- /**
3594
- * Returns all transactions for a specified payee
3595
- * @summary List payee transactions
3596
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3597
- * @param {string} payee_id - The id of the payee
3598
- * @param {Date} [since_date] - If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
3599
- * @param {&#39;uncategorized&#39; | &#39;unapproved&#39;} [type] - If specified, only transactions of the specified type will be included. \"uncategorized\" and \"unapproved\" are currently supported.
3600
- * @param {number} [last_knowledge_of_server] - The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included.
3601
- * @param {*} [options] - Override http request options.
3602
- * @throws {RequiredError}
3603
- * @memberof TransactionsApi
3604
- */
3605
- getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options) {
3606
- return (0, exports.TransactionsApiFp)(this.configuration).getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options)();
3607
- }
3608
- /**
3609
- * Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking \"Import\" on each account in the web application or tapping the \"New Transactions\" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
3610
- * @summary Import transactions
3611
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3612
- * @param {*} [options] - Override http request options.
3613
- * @throws {RequiredError}
3614
- * @memberof TransactionsApi
3615
- */
3616
- importTransactions(budget_id, options) {
3617
- return (0, exports.TransactionsApiFp)(this.configuration).importTransactions(budget_id, options)();
3618
- }
3619
- /**
3620
- * Updates a single transaction
3621
- * @summary Updates an existing transaction
3622
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3623
- * @param {string} transaction_id - The id of the transaction
3624
- * @param {PutTransactionWrapper} data - The transaction to update
3625
- * @param {*} [options] - Override http request options.
3626
- * @throws {RequiredError}
3627
- * @memberof TransactionsApi
3628
- */
3629
- updateTransaction(budget_id, transaction_id, data, options) {
3630
- return (0, exports.TransactionsApiFp)(this.configuration).updateTransaction(budget_id, transaction_id, data, options)();
3631
- }
3632
- /**
3633
- * Updates multiple transactions, by `id` or `import_id`.
3634
- * @summary Update multiple transactions
3635
- * @param {string} budget_id - The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).
3636
- * @param {PatchTransactionsWrapper} data - The transactions to update. Each transaction must have either an `id` or `import_id` specified. If `id` is specified as null an `import_id` value can be provided which will allow transaction(s) to be updated by their `import_id`. If an `id` is specified, it will always be used for lookup.
3637
- * @param {*} [options] - Override http request options.
3638
- * @throws {RequiredError}
3639
- * @memberof TransactionsApi
3640
- */
3641
- updateTransactions(budget_id, data, options) {
3642
- return (0, exports.TransactionsApiFp)(this.configuration).updateTransactions(budget_id, data, options)();
3643
- }
3644
- }
3645
- exports.TransactionsApi = TransactionsApi;
3646
- /**
3647
- * UserApi - fetch parameter creator
3648
- * @export
3649
- */
3650
- const UserApiFetchParamCreator = function (configuration) {
3651
- return {
3652
- /**
3653
- * Returns authenticated user information
3654
- * @summary User info
3655
- * @param {*} [options] - Override http request options.
3656
- * @throws {RequiredError}
3657
- */
3658
- getUser(options = {}) {
3659
- const localVarPath = `/user`;
3660
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
3661
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
3662
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
3663
- const localVarHeaderParameter = {};
3664
- const localVarQueryParameter = {};
3665
- localVarHeaderParameter["User-Agent"] = USER_AGENT;
3666
- localVarHeaderParameter["Accept"] = "application/json";
3667
- // authentication bearer required
3668
- if (configuration && configuration.apiKey) {
3669
- const localVarApiKeyValue = configuration.apiKey;
3670
- localVarHeaderParameter["Authorization"] = localVarApiKeyValue;
3671
- }
3672
- const query = new URLSearchParams(localVarUrlObj.search);
3673
- for (const key in localVarQueryParameter) {
3674
- query.set(key, localVarQueryParameter[key]);
3675
- }
3676
- for (const key in options.query) {
3677
- query.set(key, options.query[key]);
3678
- }
3679
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
3680
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
3681
- return {
3682
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
3683
- options: localVarRequestOptions,
3684
- };
3685
- },
3686
- };
3687
- };
3688
- exports.UserApiFetchParamCreator = UserApiFetchParamCreator;
3689
- /**
3690
- * UserApi - functional programming interface
3691
- * @export
3692
- */
3693
- const UserApiFp = function (configuration) {
3694
- return {
3695
- /**
3696
- * Returns authenticated user information
3697
- * @summary User info
3698
- * @param {*} [options] - Override http request options.
3699
- * @throws {RequiredError}
3700
- */
3701
- getUser(options) {
3702
- const localVarFetchArgs = (0, exports.UserApiFetchParamCreator)(configuration).getUser(options);
3703
- return (fetchFunction = fetch) => {
3704
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => __awaiter(this, void 0, void 0, function* () {
3705
- if (response.status >= 200 && response.status < 300) {
3706
- const apiResponse = yield response.json();
3707
- apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3708
- return apiResponse;
3709
- }
3710
- else {
3711
- return response.json().then((e) => {
3712
- return Promise.reject(e);
3713
- });
3714
- }
3715
- }));
3716
- };
3717
- },
3718
- };
3719
- };
3720
- exports.UserApiFp = UserApiFp;
3721
- /**
3722
- * UserApi - factory interface
3723
- * @export
3724
- */
3725
- const UserApiFactory = function (configuration) {
3726
- return {
3727
- /**
3728
- * Returns authenticated user information
3729
- * @summary User info
3730
- * @param {*} [options] - Override http request options.
3731
- * @throws {RequiredError}
3732
- */
3733
- getUser(options) {
3734
- return (0, exports.UserApiFp)(configuration).getUser(options)();
3735
- },
3736
- };
3737
- };
3738
- exports.UserApiFactory = UserApiFactory;
3739
- /**
3740
- * UserApi - object-oriented interface
3741
- * @export
3742
- * @class UserApi
3743
- * @extends {BaseAPI}
3744
- */
3745
- class UserApi extends BaseAPI {
3746
- /**
3747
- * Returns authenticated user information
3748
- * @summary User info
3749
- * @param {*} [options] - Override http request options.
3750
- * @throws {RequiredError}
3751
- * @memberof UserApi
3752
- */
3753
- getUser(options) {
3754
- return (0, exports.UserApiFp)(this.configuration).getUser(options)();
3755
- }
3756
- }
3757
- exports.UserApi = UserApi;