increase 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (554) hide show
  1. package/.prettierignore +1 -0
  2. package/.release-please-manifest.json +3 -0
  3. package/.stats.yml +1 -1
  4. package/CHANGELOG.md +130 -0
  5. package/README.md +19 -5
  6. package/api.md +99 -0
  7. package/bin/check-release-environment +25 -0
  8. package/bin/publish-npm +6 -0
  9. package/check-version.ts +4 -1
  10. package/core.ts +32 -126
  11. package/dist/cjs/check-version.d.ts +1 -0
  12. package/dist/cjs/check-version.d.ts.map +1 -0
  13. package/dist/cjs/check-version.js +3 -1
  14. package/dist/cjs/check-version.js.map +1 -1
  15. package/dist/cjs/core.d.ts +25 -55
  16. package/dist/cjs/core.d.ts.map +1 -0
  17. package/dist/cjs/core.js +43 -168
  18. package/dist/cjs/core.js.map +1 -1
  19. package/dist/cjs/error.d.ts +208 -0
  20. package/dist/cjs/error.d.ts.map +1 -0
  21. package/dist/cjs/error.js +326 -0
  22. package/dist/cjs/error.js.map +1 -0
  23. package/dist/cjs/examples/api-error.d.ts +3 -0
  24. package/dist/cjs/examples/api-error.d.ts.map +1 -0
  25. package/dist/cjs/examples/api-error.js +92 -0
  26. package/dist/cjs/examples/api-error.js.map +1 -0
  27. package/dist/cjs/fetch-polyfill.d.ts +1 -0
  28. package/dist/cjs/fetch-polyfill.d.ts.map +1 -0
  29. package/dist/cjs/fetch-polyfill.js +2 -2
  30. package/dist/cjs/fetch-polyfill.js.map +1 -1
  31. package/dist/cjs/index.d.ts +81 -22
  32. package/dist/cjs/index.d.ts.map +1 -0
  33. package/dist/cjs/index.js +80 -26
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/pagination.d.ts +4 -0
  36. package/dist/cjs/pagination.d.ts.map +1 -0
  37. package/dist/cjs/pagination.js.map +1 -1
  38. package/dist/cjs/resource.d.ts +1 -0
  39. package/dist/cjs/resource.d.ts.map +1 -0
  40. package/dist/cjs/resources/account-numbers.d.ts +26 -0
  41. package/dist/cjs/resources/account-numbers.d.ts.map +1 -0
  42. package/dist/cjs/resources/account-numbers.js.map +1 -1
  43. package/dist/cjs/resources/account-statements.d.ts +1 -0
  44. package/dist/cjs/resources/account-statements.d.ts.map +1 -0
  45. package/dist/cjs/resources/account-statements.js.map +1 -1
  46. package/dist/cjs/resources/account-transfers.d.ts +20 -11
  47. package/dist/cjs/resources/account-transfers.d.ts.map +1 -0
  48. package/dist/cjs/resources/account-transfers.js.map +1 -1
  49. package/dist/cjs/resources/accounts.d.ts +41 -19
  50. package/dist/cjs/resources/accounts.d.ts.map +1 -0
  51. package/dist/cjs/resources/accounts.js.map +1 -1
  52. package/dist/cjs/resources/ach-prenotifications.d.ts +4 -0
  53. package/dist/cjs/resources/ach-prenotifications.d.ts.map +1 -0
  54. package/dist/cjs/resources/ach-prenotifications.js.map +1 -1
  55. package/dist/cjs/resources/ach-transfers.d.ts +89 -9
  56. package/dist/cjs/resources/ach-transfers.d.ts.map +1 -0
  57. package/dist/cjs/resources/ach-transfers.js.map +1 -1
  58. package/dist/cjs/resources/balance-lookups.d.ts +47 -0
  59. package/dist/cjs/resources/balance-lookups.d.ts.map +1 -0
  60. package/dist/cjs/resources/balance-lookups.js +15 -0
  61. package/dist/cjs/resources/balance-lookups.js.map +1 -0
  62. package/dist/cjs/resources/bookkeeping-accounts.d.ts +71 -0
  63. package/dist/cjs/resources/bookkeeping-accounts.d.ts.map +1 -0
  64. package/dist/cjs/resources/bookkeeping-accounts.js +29 -0
  65. package/dist/cjs/resources/bookkeeping-accounts.js.map +1 -0
  66. package/dist/cjs/resources/bookkeeping-entries.d.ts +43 -0
  67. package/dist/cjs/resources/bookkeeping-entries.d.ts.map +1 -0
  68. package/dist/cjs/resources/bookkeeping-entries.js +19 -0
  69. package/dist/cjs/resources/bookkeeping-entries.js.map +1 -0
  70. package/dist/cjs/resources/bookkeeping-entry-sets.d.ts +83 -0
  71. package/dist/cjs/resources/bookkeeping-entry-sets.d.ts.map +1 -0
  72. package/dist/cjs/resources/bookkeeping-entry-sets.js +15 -0
  73. package/dist/cjs/resources/bookkeeping-entry-sets.js.map +1 -0
  74. package/dist/cjs/resources/card-disputes.d.ts +13 -3
  75. package/dist/cjs/resources/card-disputes.d.ts.map +1 -0
  76. package/dist/cjs/resources/card-disputes.js.map +1 -1
  77. package/dist/cjs/resources/card-profiles.d.ts +18 -2
  78. package/dist/cjs/resources/card-profiles.d.ts.map +1 -0
  79. package/dist/cjs/resources/card-profiles.js.map +1 -1
  80. package/dist/cjs/resources/cards.d.ts +31 -2
  81. package/dist/cjs/resources/cards.d.ts.map +1 -0
  82. package/dist/cjs/resources/cards.js.map +1 -1
  83. package/dist/cjs/resources/check-deposits.d.ts +16 -1
  84. package/dist/cjs/resources/check-deposits.d.ts.map +1 -0
  85. package/dist/cjs/resources/check-deposits.js.map +1 -1
  86. package/dist/cjs/resources/check-transfers.d.ts +104 -5
  87. package/dist/cjs/resources/check-transfers.d.ts.map +1 -0
  88. package/dist/cjs/resources/check-transfers.js.map +1 -1
  89. package/dist/cjs/resources/declined-transactions.d.ts +85 -23
  90. package/dist/cjs/resources/declined-transactions.d.ts.map +1 -0
  91. package/dist/cjs/resources/declined-transactions.js.map +1 -1
  92. package/dist/cjs/resources/digital-wallet-tokens.d.ts +1 -0
  93. package/dist/cjs/resources/digital-wallet-tokens.d.ts.map +1 -0
  94. package/dist/cjs/resources/digital-wallet-tokens.js.map +1 -1
  95. package/dist/cjs/resources/documents.d.ts +105 -4
  96. package/dist/cjs/resources/documents.d.ts.map +1 -0
  97. package/dist/cjs/resources/documents.js.map +1 -1
  98. package/dist/cjs/resources/entities/entities.d.ts +363 -136
  99. package/dist/cjs/resources/entities/entities.d.ts.map +1 -0
  100. package/dist/cjs/resources/entities/entities.js +1 -1
  101. package/dist/cjs/resources/entities/entities.js.map +1 -1
  102. package/dist/cjs/resources/entities/index.d.ts +7 -1
  103. package/dist/cjs/resources/entities/index.d.ts.map +1 -0
  104. package/dist/cjs/resources/entities/index.js +8 -1
  105. package/dist/cjs/resources/entities/index.js.map +1 -1
  106. package/dist/cjs/resources/entities/supplemental-documents.d.ts +36 -0
  107. package/dist/cjs/resources/entities/supplemental-documents.d.ts.map +1 -0
  108. package/dist/cjs/resources/entities/supplemental-documents.js +14 -1
  109. package/dist/cjs/resources/entities/supplemental-documents.js.map +1 -1
  110. package/dist/cjs/resources/event-subscriptions.d.ts +5 -0
  111. package/dist/cjs/resources/event-subscriptions.d.ts.map +1 -0
  112. package/dist/cjs/resources/event-subscriptions.js.map +1 -1
  113. package/dist/cjs/resources/events.d.ts +30 -24
  114. package/dist/cjs/resources/events.d.ts.map +1 -0
  115. package/dist/cjs/resources/events.js.map +1 -1
  116. package/dist/cjs/resources/exports.d.ts +162 -0
  117. package/dist/cjs/resources/exports.d.ts.map +1 -0
  118. package/dist/cjs/resources/exports.js +31 -0
  119. package/dist/cjs/resources/exports.js.map +1 -0
  120. package/dist/cjs/resources/external-accounts.d.ts +4 -2
  121. package/dist/cjs/resources/external-accounts.d.ts.map +1 -0
  122. package/dist/cjs/resources/external-accounts.js.map +1 -1
  123. package/dist/cjs/resources/files.d.ts +10 -4
  124. package/dist/cjs/resources/files.d.ts.map +1 -0
  125. package/dist/cjs/resources/files.js.map +1 -1
  126. package/dist/cjs/resources/groups.d.ts +1 -0
  127. package/dist/cjs/resources/groups.d.ts.map +1 -0
  128. package/dist/cjs/resources/inbound-ach-transfer-returns.d.ts +4 -0
  129. package/dist/cjs/resources/inbound-ach-transfer-returns.d.ts.map +1 -0
  130. package/dist/cjs/resources/inbound-ach-transfer-returns.js.map +1 -1
  131. package/dist/cjs/resources/inbound-wire-drawdown-requests.d.ts +1 -0
  132. package/dist/cjs/resources/inbound-wire-drawdown-requests.d.ts.map +1 -0
  133. package/dist/cjs/resources/inbound-wire-drawdown-requests.js.map +1 -1
  134. package/dist/cjs/resources/index.d.ts +29 -0
  135. package/dist/cjs/resources/index.d.ts.map +1 -0
  136. package/dist/cjs/resources/index.js +100 -9
  137. package/dist/cjs/resources/index.js.map +1 -1
  138. package/dist/cjs/resources/limits.d.ts +1 -0
  139. package/dist/cjs/resources/limits.d.ts.map +1 -0
  140. package/dist/cjs/resources/limits.js.map +1 -1
  141. package/dist/cjs/resources/oauth-connections.d.ts +1 -0
  142. package/dist/cjs/resources/oauth-connections.d.ts.map +1 -0
  143. package/dist/cjs/resources/oauth-connections.js.map +1 -1
  144. package/dist/cjs/resources/pending-transactions.d.ts +115 -36
  145. package/dist/cjs/resources/pending-transactions.d.ts.map +1 -0
  146. package/dist/cjs/resources/pending-transactions.js.map +1 -1
  147. package/dist/cjs/resources/programs.d.ts +48 -0
  148. package/dist/cjs/resources/programs.d.ts.map +1 -0
  149. package/dist/cjs/resources/programs.js +25 -0
  150. package/dist/cjs/resources/programs.js.map +1 -0
  151. package/dist/cjs/resources/real-time-decisions.d.ts +43 -7
  152. package/dist/cjs/resources/real-time-decisions.d.ts.map +1 -0
  153. package/dist/cjs/resources/real-time-payments-transfers.d.ts +287 -0
  154. package/dist/cjs/resources/real-time-payments-transfers.d.ts.map +1 -0
  155. package/dist/cjs/resources/real-time-payments-transfers.js +35 -0
  156. package/dist/cjs/resources/real-time-payments-transfers.js.map +1 -0
  157. package/dist/cjs/resources/routing-numbers.d.ts +1 -0
  158. package/dist/cjs/resources/routing-numbers.d.ts.map +1 -0
  159. package/dist/cjs/resources/shared.d.ts +1 -0
  160. package/dist/cjs/resources/shared.d.ts.map +1 -0
  161. package/dist/cjs/resources/simulations/account-statements.d.ts +1 -0
  162. package/dist/cjs/resources/simulations/account-statements.d.ts.map +1 -0
  163. package/dist/cjs/resources/simulations/account-transfers.d.ts +1 -0
  164. package/dist/cjs/resources/simulations/account-transfers.d.ts.map +1 -0
  165. package/dist/cjs/resources/simulations/ach-transfers.d.ts +470 -157
  166. package/dist/cjs/resources/simulations/ach-transfers.d.ts.map +1 -0
  167. package/dist/cjs/resources/simulations/card-disputes.d.ts +1 -0
  168. package/dist/cjs/resources/simulations/card-disputes.d.ts.map +1 -0
  169. package/dist/cjs/resources/simulations/card-refunds.d.ts +1 -0
  170. package/dist/cjs/resources/simulations/card-refunds.d.ts.map +1 -0
  171. package/dist/cjs/resources/simulations/cards.d.ts +188 -56
  172. package/dist/cjs/resources/simulations/cards.d.ts.map +1 -0
  173. package/dist/cjs/resources/simulations/check-deposits.d.ts +1 -0
  174. package/dist/cjs/resources/simulations/check-deposits.d.ts.map +1 -0
  175. package/dist/cjs/resources/simulations/check-transfers.d.ts +16 -0
  176. package/dist/cjs/resources/simulations/check-transfers.d.ts.map +1 -0
  177. package/dist/cjs/resources/simulations/check-transfers.js +10 -0
  178. package/dist/cjs/resources/simulations/check-transfers.js.map +1 -1
  179. package/dist/cjs/resources/simulations/digital-wallet-token-requests.d.ts +1 -0
  180. package/dist/cjs/resources/simulations/digital-wallet-token-requests.d.ts.map +1 -0
  181. package/dist/cjs/resources/simulations/documents.d.ts +1 -0
  182. package/dist/cjs/resources/simulations/documents.d.ts.map +1 -0
  183. package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.d.ts +1 -0
  184. package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.d.ts.map +1 -0
  185. package/dist/cjs/resources/simulations/index.d.ts +5 -0
  186. package/dist/cjs/resources/simulations/index.d.ts.map +1 -0
  187. package/dist/cjs/resources/simulations/interest-payments.d.ts +1237 -0
  188. package/dist/cjs/resources/simulations/interest-payments.d.ts.map +1 -0
  189. package/dist/cjs/resources/simulations/interest-payments.js +16 -0
  190. package/dist/cjs/resources/simulations/interest-payments.js.map +1 -0
  191. package/dist/cjs/resources/simulations/programs.d.ts +21 -0
  192. package/dist/cjs/resources/simulations/programs.d.ts.map +1 -0
  193. package/dist/cjs/resources/simulations/programs.js +17 -0
  194. package/dist/cjs/resources/simulations/programs.js.map +1 -0
  195. package/dist/cjs/resources/simulations/real-time-payments-transfers.d.ts +470 -155
  196. package/dist/cjs/resources/simulations/real-time-payments-transfers.d.ts.map +1 -0
  197. package/dist/cjs/resources/simulations/real-time-payments-transfers.js +11 -0
  198. package/dist/cjs/resources/simulations/real-time-payments-transfers.js.map +1 -1
  199. package/dist/cjs/resources/simulations/simulations.d.ts +5 -0
  200. package/dist/cjs/resources/simulations/simulations.d.ts.map +1 -0
  201. package/dist/cjs/resources/simulations/simulations.js +4 -0
  202. package/dist/cjs/resources/simulations/simulations.js.map +1 -1
  203. package/dist/cjs/resources/simulations/wire-transfers.d.ts +332 -133
  204. package/dist/cjs/resources/simulations/wire-transfers.d.ts.map +1 -0
  205. package/dist/cjs/resources/transactions.d.ts +353 -165
  206. package/dist/cjs/resources/transactions.d.ts.map +1 -0
  207. package/dist/cjs/resources/transactions.js.map +1 -1
  208. package/dist/cjs/resources/wire-drawdown-requests.d.ts +5 -0
  209. package/dist/cjs/resources/wire-drawdown-requests.d.ts.map +1 -0
  210. package/dist/cjs/resources/wire-drawdown-requests.js.map +1 -1
  211. package/dist/cjs/resources/wire-transfers.d.ts +39 -4
  212. package/dist/cjs/resources/wire-transfers.d.ts.map +1 -0
  213. package/dist/cjs/resources/wire-transfers.js.map +1 -1
  214. package/dist/cjs/streaming.d.ts +13 -0
  215. package/dist/cjs/streaming.d.ts.map +1 -0
  216. package/dist/cjs/streaming.js +282 -0
  217. package/dist/cjs/streaming.js.map +1 -0
  218. package/dist/cjs/tests/api-resources/account-numbers.test.d.ts +1 -0
  219. package/dist/cjs/tests/api-resources/account-numbers.test.d.ts.map +1 -0
  220. package/dist/cjs/tests/api-resources/account-numbers.test.js +25 -28
  221. package/dist/cjs/tests/api-resources/account-numbers.test.js.map +1 -1
  222. package/dist/cjs/tests/api-resources/account-statements.test.d.ts +1 -0
  223. package/dist/cjs/tests/api-resources/account-statements.test.d.ts.map +1 -0
  224. package/dist/cjs/tests/api-resources/account-statements.test.js +7 -20
  225. package/dist/cjs/tests/api-resources/account-statements.test.js.map +1 -1
  226. package/dist/cjs/tests/api-resources/account-transfers.test.d.ts +1 -0
  227. package/dist/cjs/tests/api-resources/account-transfers.test.d.ts.map +1 -0
  228. package/dist/cjs/tests/api-resources/account-transfers.test.js +16 -29
  229. package/dist/cjs/tests/api-resources/account-transfers.test.js.map +1 -1
  230. package/dist/cjs/tests/api-resources/accounts.test.d.ts +1 -0
  231. package/dist/cjs/tests/api-resources/accounts.test.d.ts.map +1 -0
  232. package/dist/cjs/tests/api-resources/accounts.test.js +22 -23
  233. package/dist/cjs/tests/api-resources/accounts.test.js.map +1 -1
  234. package/dist/cjs/tests/api-resources/ach-prenotifications.test.d.ts +1 -0
  235. package/dist/cjs/tests/api-resources/ach-prenotifications.test.d.ts.map +1 -0
  236. package/dist/cjs/tests/api-resources/ach-prenotifications.test.js +12 -24
  237. package/dist/cjs/tests/api-resources/ach-prenotifications.test.js.map +1 -1
  238. package/dist/cjs/tests/api-resources/ach-transfers.test.d.ts +1 -0
  239. package/dist/cjs/tests/api-resources/ach-transfers.test.d.ts.map +1 -0
  240. package/dist/cjs/tests/api-resources/ach-transfers.test.js +17 -31
  241. package/dist/cjs/tests/api-resources/ach-transfers.test.js.map +1 -1
  242. package/dist/cjs/tests/api-resources/balance-lookups.test.d.ts +2 -0
  243. package/dist/cjs/tests/api-resources/balance-lookups.test.d.ts.map +1 -0
  244. package/dist/cjs/tests/api-resources/balance-lookups.test.js +55 -0
  245. package/dist/cjs/tests/api-resources/balance-lookups.test.js.map +1 -0
  246. package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.d.ts +2 -0
  247. package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.d.ts.map +1 -0
  248. package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.js +78 -0
  249. package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.js.map +1 -0
  250. package/dist/cjs/tests/api-resources/bookkeeping-entries.test.d.ts +2 -0
  251. package/dist/cjs/tests/api-resources/bookkeeping-entries.test.d.ts.map +1 -0
  252. package/dist/cjs/tests/api-resources/bookkeeping-entries.test.js +65 -0
  253. package/dist/cjs/tests/api-resources/bookkeeping-entries.test.js.map +1 -0
  254. package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.d.ts +2 -0
  255. package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.d.ts.map +1 -0
  256. package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.js +66 -0
  257. package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.js.map +1 -0
  258. package/dist/cjs/tests/api-resources/card-disputes.test.d.ts +1 -0
  259. package/dist/cjs/tests/api-resources/card-disputes.test.d.ts.map +1 -0
  260. package/dist/cjs/tests/api-resources/card-disputes.test.js +18 -24
  261. package/dist/cjs/tests/api-resources/card-disputes.test.js.map +1 -1
  262. package/dist/cjs/tests/api-resources/card-profiles.test.d.ts +1 -0
  263. package/dist/cjs/tests/api-resources/card-profiles.test.d.ts.map +1 -0
  264. package/dist/cjs/tests/api-resources/card-profiles.test.js +28 -19
  265. package/dist/cjs/tests/api-resources/card-profiles.test.js.map +1 -1
  266. package/dist/cjs/tests/api-resources/cards.test.d.ts +1 -0
  267. package/dist/cjs/tests/api-resources/cards.test.d.ts.map +1 -0
  268. package/dist/cjs/tests/api-resources/cards.test.js +13 -35
  269. package/dist/cjs/tests/api-resources/cards.test.js.map +1 -1
  270. package/dist/cjs/tests/api-resources/check-deposits.test.d.ts +1 -0
  271. package/dist/cjs/tests/api-resources/check-deposits.test.d.ts.map +1 -0
  272. package/dist/cjs/tests/api-resources/check-deposits.test.js +24 -27
  273. package/dist/cjs/tests/api-resources/check-deposits.test.js.map +1 -1
  274. package/dist/cjs/tests/api-resources/check-transfers.test.d.ts +1 -0
  275. package/dist/cjs/tests/api-resources/check-transfers.test.d.ts.map +1 -0
  276. package/dist/cjs/tests/api-resources/check-transfers.test.js +27 -40
  277. package/dist/cjs/tests/api-resources/check-transfers.test.js.map +1 -1
  278. package/dist/cjs/tests/api-resources/declined-transactions.test.d.ts +1 -0
  279. package/dist/cjs/tests/api-resources/declined-transactions.test.d.ts.map +1 -0
  280. package/dist/cjs/tests/api-resources/declined-transactions.test.js +9 -23
  281. package/dist/cjs/tests/api-resources/declined-transactions.test.js.map +1 -1
  282. package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.d.ts +1 -0
  283. package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.d.ts.map +1 -0
  284. package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.js +8 -21
  285. package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.js.map +1 -1
  286. package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
  287. package/dist/cjs/tests/api-resources/documents.test.d.ts.map +1 -0
  288. package/dist/cjs/tests/api-resources/documents.test.js +15 -23
  289. package/dist/cjs/tests/api-resources/documents.test.js.map +1 -1
  290. package/dist/cjs/tests/api-resources/entities/entities.test.d.ts +1 -0
  291. package/dist/cjs/tests/api-resources/entities/entities.test.d.ts.map +1 -0
  292. package/dist/cjs/tests/api-resources/entities/entities.test.js +40 -31
  293. package/dist/cjs/tests/api-resources/entities/entities.test.js.map +1 -1
  294. package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.d.ts +1 -0
  295. package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.d.ts.map +1 -0
  296. package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.js +25 -6
  297. package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.js.map +1 -1
  298. package/dist/cjs/tests/api-resources/event-subscriptions.test.d.ts +1 -0
  299. package/dist/cjs/tests/api-resources/event-subscriptions.test.d.ts.map +1 -0
  300. package/dist/cjs/tests/api-resources/event-subscriptions.test.js +10 -20
  301. package/dist/cjs/tests/api-resources/event-subscriptions.test.js.map +1 -1
  302. package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
  303. package/dist/cjs/tests/api-resources/events.test.d.ts.map +1 -0
  304. package/dist/cjs/tests/api-resources/events.test.js +8 -22
  305. package/dist/cjs/tests/api-resources/events.test.js.map +1 -1
  306. package/dist/cjs/tests/api-resources/exports.test.d.ts +2 -0
  307. package/dist/cjs/tests/api-resources/exports.test.d.ts.map +1 -0
  308. package/dist/cjs/tests/api-resources/exports.test.js +101 -0
  309. package/dist/cjs/tests/api-resources/exports.test.js.map +1 -0
  310. package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
  311. package/dist/cjs/tests/api-resources/external-accounts.test.d.ts.map +1 -0
  312. package/dist/cjs/tests/api-resources/external-accounts.test.js +13 -27
  313. package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -1
  314. package/dist/cjs/tests/api-resources/files.test.d.ts +1 -0
  315. package/dist/cjs/tests/api-resources/files.test.d.ts.map +1 -0
  316. package/dist/cjs/tests/api-resources/files.test.js +8 -21
  317. package/dist/cjs/tests/api-resources/files.test.js.map +1 -1
  318. package/dist/cjs/tests/api-resources/groups.test.d.ts +1 -0
  319. package/dist/cjs/tests/api-resources/groups.test.d.ts.map +1 -0
  320. package/dist/cjs/tests/api-resources/groups.test.js +6 -5
  321. package/dist/cjs/tests/api-resources/groups.test.js.map +1 -1
  322. package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.d.ts +1 -0
  323. package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.d.ts.map +1 -0
  324. package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.js +16 -12
  325. package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.js.map +1 -1
  326. package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.d.ts +1 -0
  327. package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.d.ts.map +1 -0
  328. package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.js +6 -9
  329. package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.js.map +1 -1
  330. package/dist/cjs/tests/api-resources/limits.test.d.ts +1 -0
  331. package/dist/cjs/tests/api-resources/limits.test.d.ts.map +1 -0
  332. package/dist/cjs/tests/api-resources/limits.test.js +14 -17
  333. package/dist/cjs/tests/api-resources/limits.test.js.map +1 -1
  334. package/dist/cjs/tests/api-resources/oauth-connections.test.d.ts +1 -0
  335. package/dist/cjs/tests/api-resources/oauth-connections.test.d.ts.map +1 -0
  336. package/dist/cjs/tests/api-resources/oauth-connections.test.js +6 -9
  337. package/dist/cjs/tests/api-resources/oauth-connections.test.js.map +1 -1
  338. package/dist/cjs/tests/api-resources/pending-transactions.test.d.ts +1 -0
  339. package/dist/cjs/tests/api-resources/pending-transactions.test.d.ts.map +1 -0
  340. package/dist/cjs/tests/api-resources/pending-transactions.test.js +13 -17
  341. package/dist/cjs/tests/api-resources/pending-transactions.test.js.map +1 -1
  342. package/dist/cjs/tests/api-resources/programs.test.d.ts +2 -0
  343. package/dist/cjs/tests/api-resources/programs.test.d.ts.map +1 -0
  344. package/dist/cjs/tests/api-resources/programs.test.js +73 -0
  345. package/dist/cjs/tests/api-resources/programs.test.js.map +1 -0
  346. package/dist/cjs/tests/api-resources/real-time-decisions.test.d.ts +1 -0
  347. package/dist/cjs/tests/api-resources/real-time-decisions.test.d.ts.map +1 -0
  348. package/dist/cjs/tests/api-resources/real-time-decisions.test.js +6 -16
  349. package/dist/cjs/tests/api-resources/real-time-decisions.test.js.map +1 -1
  350. package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.d.ts +2 -0
  351. package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.d.ts.map +1 -0
  352. package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.js +113 -0
  353. package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.js.map +1 -0
  354. package/dist/cjs/tests/api-resources/routing-numbers.test.d.ts +1 -0
  355. package/dist/cjs/tests/api-resources/routing-numbers.test.d.ts.map +1 -0
  356. package/dist/cjs/tests/api-resources/routing-numbers.test.js +6 -5
  357. package/dist/cjs/tests/api-resources/routing-numbers.test.js.map +1 -1
  358. package/dist/cjs/tests/api-resources/simulations/account-statements.test.d.ts +1 -0
  359. package/dist/cjs/tests/api-resources/simulations/account-statements.test.d.ts.map +1 -0
  360. package/dist/cjs/tests/api-resources/simulations/account-statements.test.js +11 -8
  361. package/dist/cjs/tests/api-resources/simulations/account-statements.test.js.map +1 -1
  362. package/dist/cjs/tests/api-resources/simulations/account-transfers.test.d.ts +1 -0
  363. package/dist/cjs/tests/api-resources/simulations/account-transfers.test.d.ts.map +1 -0
  364. package/dist/cjs/tests/api-resources/simulations/account-transfers.test.js +5 -4
  365. package/dist/cjs/tests/api-resources/simulations/account-transfers.test.js.map +1 -1
  366. package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.d.ts +1 -0
  367. package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.d.ts.map +1 -0
  368. package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.js +13 -19
  369. package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.js.map +1 -1
  370. package/dist/cjs/tests/api-resources/simulations/card-disputes.test.d.ts +1 -0
  371. package/dist/cjs/tests/api-resources/simulations/card-disputes.test.d.ts.map +1 -0
  372. package/dist/cjs/tests/api-resources/simulations/card-disputes.test.js +8 -7
  373. package/dist/cjs/tests/api-resources/simulations/card-disputes.test.js.map +1 -1
  374. package/dist/cjs/tests/api-resources/simulations/card-refunds.test.d.ts +1 -0
  375. package/dist/cjs/tests/api-resources/simulations/card-refunds.test.d.ts.map +1 -0
  376. package/dist/cjs/tests/api-resources/simulations/card-refunds.test.js +11 -8
  377. package/dist/cjs/tests/api-resources/simulations/card-refunds.test.js.map +1 -1
  378. package/dist/cjs/tests/api-resources/simulations/cards.test.d.ts +1 -0
  379. package/dist/cjs/tests/api-resources/simulations/cards.test.d.ts.map +1 -0
  380. package/dist/cjs/tests/api-resources/simulations/cards.test.js +12 -10
  381. package/dist/cjs/tests/api-resources/simulations/cards.test.js.map +1 -1
  382. package/dist/cjs/tests/api-resources/simulations/check-deposits.test.d.ts +1 -0
  383. package/dist/cjs/tests/api-resources/simulations/check-deposits.test.d.ts.map +1 -0
  384. package/dist/cjs/tests/api-resources/simulations/check-deposits.test.js +5 -4
  385. package/dist/cjs/tests/api-resources/simulations/check-deposits.test.js.map +1 -1
  386. package/dist/cjs/tests/api-resources/simulations/check-transfers.test.d.ts +1 -0
  387. package/dist/cjs/tests/api-resources/simulations/check-transfers.test.d.ts.map +1 -0
  388. package/dist/cjs/tests/api-resources/simulations/check-transfers.test.js +23 -4
  389. package/dist/cjs/tests/api-resources/simulations/check-transfers.test.js.map +1 -1
  390. package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.d.ts +1 -0
  391. package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.d.ts.map +1 -0
  392. package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.js +11 -8
  393. package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.js.map +1 -1
  394. package/dist/cjs/tests/api-resources/simulations/documents.test.d.ts +1 -0
  395. package/dist/cjs/tests/api-resources/simulations/documents.test.d.ts.map +1 -0
  396. package/dist/cjs/tests/api-resources/simulations/documents.test.js +10 -7
  397. package/dist/cjs/tests/api-resources/simulations/documents.test.js.map +1 -1
  398. package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.d.ts +1 -0
  399. package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.d.ts.map +1 -0
  400. package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.js +29 -28
  401. package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.js.map +1 -1
  402. package/dist/cjs/tests/api-resources/simulations/interest-payments.test.d.ts +2 -0
  403. package/dist/cjs/tests/api-resources/simulations/interest-payments.test.d.ts.map +1 -0
  404. package/dist/cjs/tests/api-resources/simulations/interest-payments.test.js +58 -0
  405. package/dist/cjs/tests/api-resources/simulations/interest-payments.test.js.map +1 -0
  406. package/dist/cjs/tests/api-resources/simulations/programs.test.d.ts +2 -0
  407. package/dist/cjs/tests/api-resources/simulations/programs.test.d.ts.map +1 -0
  408. package/dist/cjs/tests/api-resources/simulations/programs.test.js +52 -0
  409. package/dist/cjs/tests/api-resources/simulations/programs.test.js.map +1 -0
  410. package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.d.ts +1 -0
  411. package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.d.ts.map +1 -0
  412. package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.js +20 -12
  413. package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.js.map +1 -1
  414. package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.d.ts +1 -0
  415. package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.d.ts.map +1 -0
  416. package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.js +11 -10
  417. package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.js.map +1 -1
  418. package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
  419. package/dist/cjs/tests/api-resources/transactions.test.d.ts.map +1 -0
  420. package/dist/cjs/tests/api-resources/transactions.test.js +11 -28
  421. package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -1
  422. package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.d.ts +1 -0
  423. package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.d.ts.map +1 -0
  424. package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.js +20 -23
  425. package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.js.map +1 -1
  426. package/dist/cjs/tests/api-resources/wire-transfers.test.d.ts +1 -0
  427. package/dist/cjs/tests/api-resources/wire-transfers.test.d.ts.map +1 -0
  428. package/dist/cjs/tests/api-resources/wire-transfers.test.js +22 -36
  429. package/dist/cjs/tests/api-resources/wire-transfers.test.js.map +1 -1
  430. package/dist/cjs/tests/form.test.d.ts +1 -0
  431. package/dist/cjs/tests/form.test.d.ts.map +1 -0
  432. package/dist/cjs/tests/form.test.js +4 -3
  433. package/dist/cjs/tests/index.test.d.ts +1 -0
  434. package/dist/cjs/tests/index.test.d.ts.map +1 -0
  435. package/dist/cjs/tests/index.test.js +36 -4
  436. package/dist/cjs/tests/index.test.js.map +1 -1
  437. package/dist/cjs/tests/responses.test.d.ts +1 -0
  438. package/dist/cjs/tests/responses.test.d.ts.map +1 -0
  439. package/dist/cjs/tests/responses.test.js +4 -3
  440. package/dist/cjs/version.d.ts +2 -1
  441. package/dist/cjs/version.d.ts.map +1 -0
  442. package/dist/cjs/version.js +1 -1
  443. package/dist/cjs/version.js.map +1 -1
  444. package/error.ts +505 -0
  445. package/examples/api-error.ts +21 -0
  446. package/fetch-polyfill.ts +2 -2
  447. package/index.ts +90 -20
  448. package/package.json +2 -2
  449. package/pagination.ts +3 -0
  450. package/release-please-config.json +61 -0
  451. package/resources/account-numbers.ts +30 -1
  452. package/resources/account-statements.ts +0 -1
  453. package/resources/account-transfers.ts +21 -13
  454. package/resources/accounts.ts +48 -23
  455. package/resources/ach-prenotifications.ts +3 -1
  456. package/resources/ach-transfers.ts +92 -11
  457. package/resources/balance-lookups.ts +57 -0
  458. package/resources/bookkeeping-accounts.ts +98 -0
  459. package/resources/bookkeeping-entries.ts +62 -0
  460. package/resources/bookkeeping-entry-sets.ts +100 -0
  461. package/resources/card-disputes.ts +12 -4
  462. package/resources/card-profiles.ts +17 -3
  463. package/resources/cards.ts +30 -3
  464. package/resources/check-deposits.ts +15 -2
  465. package/resources/check-transfers.ts +117 -7
  466. package/resources/declined-transactions.ts +96 -27
  467. package/resources/digital-wallet-tokens.ts +0 -1
  468. package/resources/documents.ts +104 -5
  469. package/resources/entities/entities.ts +443 -212
  470. package/resources/entities/index.ts +6 -1
  471. package/resources/entities/supplemental-documents.ts +46 -0
  472. package/resources/event-subscriptions.ts +4 -1
  473. package/resources/events.ts +33 -29
  474. package/resources/exports.ts +204 -0
  475. package/resources/external-accounts.ts +3 -3
  476. package/resources/files.ts +9 -5
  477. package/resources/inbound-ach-transfer-returns.ts +3 -1
  478. package/resources/inbound-wire-drawdown-requests.ts +0 -1
  479. package/resources/index.ts +28 -0
  480. package/resources/limits.ts +0 -1
  481. package/resources/oauth-connections.ts +0 -1
  482. package/resources/pending-transactions.ts +126 -48
  483. package/resources/programs.ts +70 -0
  484. package/resources/real-time-decisions.ts +43 -8
  485. package/resources/real-time-payments-transfers.ts +351 -0
  486. package/resources/simulations/ach-transfers.ts +504 -192
  487. package/resources/simulations/cards.ts +206 -69
  488. package/resources/simulations/check-transfers.ts +19 -0
  489. package/resources/simulations/index.ts +4 -0
  490. package/resources/simulations/interest-payments.ts +1501 -0
  491. package/resources/simulations/programs.ts +26 -0
  492. package/resources/simulations/real-time-payments-transfers.ts +512 -190
  493. package/resources/simulations/simulations.ts +4 -0
  494. package/resources/simulations/wire-transfers.ts +354 -165
  495. package/resources/transactions.ts +379 -202
  496. package/resources/wire-drawdown-requests.ts +4 -1
  497. package/resources/wire-transfers.ts +43 -6
  498. package/streaming.ts +199 -0
  499. package/tests/api-resources/account-numbers.test.ts +22 -25
  500. package/tests/api-resources/account-statements.test.ts +4 -17
  501. package/tests/api-resources/account-transfers.test.ts +13 -26
  502. package/tests/api-resources/accounts.test.ts +19 -20
  503. package/tests/api-resources/ach-prenotifications.test.ts +9 -21
  504. package/tests/api-resources/ach-transfers.test.ts +14 -28
  505. package/tests/api-resources/balance-lookups.test.ts +18 -0
  506. package/tests/api-resources/bookkeeping-accounts.test.ts +38 -0
  507. package/tests/api-resources/bookkeeping-entries.test.ts +25 -0
  508. package/tests/api-resources/bookkeeping-entry-sets.test.ts +29 -0
  509. package/tests/api-resources/card-disputes.test.ts +15 -21
  510. package/tests/api-resources/card-profiles.test.ts +25 -16
  511. package/tests/api-resources/cards.test.ts +10 -32
  512. package/tests/api-resources/check-deposits.test.ts +21 -24
  513. package/tests/api-resources/check-transfers.test.ts +24 -37
  514. package/tests/api-resources/declined-transactions.test.ts +6 -20
  515. package/tests/api-resources/digital-wallet-tokens.test.ts +5 -18
  516. package/tests/api-resources/documents.test.ts +8 -20
  517. package/tests/api-resources/entities/entities.test.ts +37 -31
  518. package/tests/api-resources/entities/supplemental-documents.test.ts +22 -3
  519. package/tests/api-resources/event-subscriptions.test.ts +7 -17
  520. package/tests/api-resources/events.test.ts +5 -19
  521. package/tests/api-resources/exports.test.ts +64 -0
  522. package/tests/api-resources/external-accounts.test.ts +10 -24
  523. package/tests/api-resources/files.test.ts +5 -19
  524. package/tests/api-resources/groups.test.ts +3 -2
  525. package/tests/api-resources/inbound-ach-transfer-returns.test.ts +13 -9
  526. package/tests/api-resources/inbound-wire-drawdown-requests.test.ts +3 -6
  527. package/tests/api-resources/limits.test.ts +11 -14
  528. package/tests/api-resources/oauth-connections.test.ts +3 -6
  529. package/tests/api-resources/pending-transactions.test.ts +10 -14
  530. package/tests/api-resources/programs.test.ts +36 -0
  531. package/tests/api-resources/real-time-decisions.test.ts +3 -13
  532. package/tests/api-resources/real-time-payments-transfers.test.ts +76 -0
  533. package/tests/api-resources/routing-numbers.test.ts +3 -2
  534. package/tests/api-resources/simulations/account-statements.test.ts +8 -5
  535. package/tests/api-resources/simulations/account-transfers.test.ts +2 -1
  536. package/tests/api-resources/simulations/ach-transfers.test.ts +10 -16
  537. package/tests/api-resources/simulations/card-disputes.test.ts +5 -4
  538. package/tests/api-resources/simulations/card-refunds.test.ts +8 -5
  539. package/tests/api-resources/simulations/cards.test.ts +9 -7
  540. package/tests/api-resources/simulations/check-deposits.test.ts +2 -1
  541. package/tests/api-resources/simulations/check-transfers.test.ts +14 -1
  542. package/tests/api-resources/simulations/digital-wallet-token-requests.test.ts +8 -5
  543. package/tests/api-resources/simulations/documents.test.ts +7 -4
  544. package/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.ts +26 -25
  545. package/tests/api-resources/simulations/interest-payments.test.ts +15 -0
  546. package/tests/api-resources/simulations/programs.test.ts +15 -0
  547. package/tests/api-resources/simulations/real-time-payments-transfers.test.ts +17 -9
  548. package/tests/api-resources/simulations/wire-transfers.test.ts +8 -7
  549. package/tests/api-resources/transactions.test.ts +8 -25
  550. package/tests/api-resources/wire-drawdown-requests.test.ts +17 -20
  551. package/tests/api-resources/wire-transfers.test.ts +19 -33
  552. package/tests/index.test.ts +30 -1
  553. package/tsconfig.json +2 -0
  554. package/version.ts +1 -1
@@ -0,0 +1 @@
1
+ CHANGELOG.md
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.0"
3
+ }
package/.stats.yml CHANGED
@@ -1 +1 @@
1
- configured_endpoints: 115
1
+ configured_endpoints: 133
package/CHANGELOG.md ADDED
@@ -0,0 +1,130 @@
1
+ # Changelog
2
+
3
+ ## [0.4.0](https://github.com/Increase/increase-node/compare/v0.3.0...v0.4.0) (2023-06-19)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * drop official support for EOL Node versions (Node 12, 13, 14, 15) ([#18](https://github.com/Increase/increase-node/issues/18))
9
+ * **api:** rename return reason enum member ([#12](https://github.com/Increase/increase-node/issues/12))
10
+ * change nested query parameters to be objects ([#8](https://github.com/Increase/increase-node/issues/8))
11
+
12
+
13
+ ### Features
14
+ * **client:** add support for specifying client-level default headers ([#5](https://github.com/Increase/increase-node/issues/5)) ([609c71a](https://github.com/Increase/increase-node/commit/609c71a7f657ec14fba3fa919d8b0dd4ff1ecb5d))
15
+ * **api:** add new endpoints + properties + enums ([#9](https://github.com/Increase/increase-node/issues/9)) ([8fd90c4](https://github.com/Increase/increase-node/commit/8fd90c4b8a50ce9f5a23cc17ee71508df6e34eca))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **internal:** improve stream cancellation handling of abort controllers ([#17](https://github.com/Increase/increase-node/issues/17)) ([e8f15dd](https://github.com/Increase/increase-node/commit/e8f15dd5c2001dd6b3023266a2471c019ed96739))
21
+
22
+
23
+ ### Chores
24
+
25
+ * **internal:** improve SSE decoding of lines ([#14](https://github.com/Increase/increase-node/issues/14)) ([74b9bdc](https://github.com/Increase/increase-node/commit/74b9bdcaa44639cd99865d8a2701a2232314f0fd))
26
+ * **internal:** restructure core streaming implementation ([#7](https://github.com/Increase/increase-node/issues/7)) ([b97964b](https://github.com/Increase/increase-node/commit/b97964bd5e22ed7ce4ffdd8e4a8fe5005db40976))
27
+
28
+
29
+ ### Refactors
30
+
31
+ * **api:** remove unused properties and enum members ([#16](https://github.com/Increase/increase-node/issues/16)) ([51c8ab5](https://github.com/Increase/increase-node/commit/51c8ab5e5415d722768af8c53c5c8453398545a6))
32
+ * change nested query parameters to be objects ([#8](https://github.com/Increase/increase-node/issues/8)) ([fdcd3a4](https://github.com/Increase/increase-node/commit/fdcd3a47ff31cece47a646853086f9d9e024720c))
33
+ * **api:** rename return reason enum member ([#12](https://github.com/Increase/increase-node/issues/12)) ([51ba5d4](https://github.com/Increase/increase-node/commit/51ba5d42e07dbde522cf7ff49863fc0935c350bb))
34
+ * **docs:** cleanup api.md response types ([539848e](https://github.com/Increase/increase-node/commit/539848e9001e424f9492f60d82cfb861316cfcb2))
35
+ * move error type definitions to error.ts ([#15](https://github.com/Increase/increase-node/issues/15)) ([e50a9a1](https://github.com/Increase/increase-node/commit/e50a9a1f43e107ae989306f73f210e6b88493d60))
36
+
37
+
38
+ ### Documentation
39
+
40
+ * drop official support for EOL Node versions (Node 12, 13, 14, 15) ([#18](https://github.com/Increase/increase-node/issues/18)) ([f3be71b](https://github.com/Increase/increase-node/commit/f3be71b1191f72a6785f6be07dcf79b45b9640ac))
41
+ * point to github repo instead of email contact ([#13](https://github.com/Increase/increase-node/issues/13)) ([72d7fef](https://github.com/Increase/increase-node/commit/72d7fef408e625906e2ec59c29b9a63ea5a9d64c))
42
+ * slight improvement to file uploads example ([#10](https://github.com/Increase/increase-node/issues/10)) ([b134725](https://github.com/Increase/increase-node/commit/b1347253a900c1af41a66363bc225a2b09a9e4c3))
43
+
44
+
45
+ ### Build System
46
+
47
+ * add `.github` folder to `.npmignore` ([#19](https://github.com/Increase/increase-node/issues/19)) ([a263289](https://github.com/Increase/increase-node/commit/a263289da32b5e0d708c5c21a92a6a58faf74abc))
48
+
49
+ ## [0.3.0](https://github.com/Increase/increase-node/compare/increase-v0.2.0...increase-v0.3.0) (2023-05-31)
50
+
51
+
52
+ ### ⚠ BREAKING CHANGES
53
+
54
+ * **api:** `notification_of_change` has been removed in favor of the new `notifications_of_change` list field
55
+
56
+ ### Features
57
+
58
+ * add additional coercion functions ([5f106bf](https://github.com/Increase/increase-node/commit/5f106bf9d3e0ee1c5b5fc81d112677e2c7580b82))
59
+ * add internal support for streaming responses ([a1c321e](https://github.com/Increase/increase-node/commit/a1c321edc8fd648c9f318e047db5dafb7e37eabe))
60
+ * add internal support for streaming responses ([a1c321e](https://github.com/Increase/increase-node/commit/a1c321edc8fd648c9f318e047db5dafb7e37eabe))
61
+ * add webhook HMAC verification helper methods ([7a00853](https://github.com/Increase/increase-node/commit/7a00853a03b5b606df2c5c9095c53db2a4957af8))
62
+ * **api:** add `at_time` property for balance lookups ([0b6c0de](https://github.com/Increase/increase-node/commit/0b6c0de8d25b04fb95b16d902d90d116d617af76))
63
+ * **api:** add `collection_receivable` to transaction source category enum ([e743cc9](https://github.com/Increase/increase-node/commit/e743cc9ad5855d7c16b2c1f3a1a41dc06581d01d))
64
+ * **api:** add `expires_at` property ([c257707](https://github.com/Increase/increase-node/commit/c2577077bd280793bedf9ff8f802017784da7468))
65
+ * **api:** add `simulations.checkTransfers.return()` method ([e7d330a](https://github.com/Increase/increase-node/commit/e7d330ab5d899ed2305530c0f23fe1fe36eee1a8))
66
+ * **api:** add `simulations.checkTransfers.return()` method ([e7d330a](https://github.com/Increase/increase-node/commit/e7d330ab5d899ed2305530c0f23fe1fe36eee1a8))
67
+ * **api:** add bookkeeping accounts, entries, and entry sets, and several other changes ([d63d4e7](https://github.com/Increase/increase-node/commit/d63d4e71e0d10e70f8d9257ff3ad903b41c64fbe))
68
+ * **api:** add new endpoints ([7d4ebe6](https://github.com/Increase/increase-node/commit/7d4ebe6f0a38e7fade250ece8e50c8d9f6c6d653))
69
+ * **api:** add new endpoints, several params, fields, enum members, and documentation updates ([8ffb013](https://github.com/Increase/increase-node/commit/8ffb0130a53a90c5b00c314850f33bc5af4cb070))
70
+ * **api:** add new enum members ([0785f7a](https://github.com/Increase/increase-node/commit/0785f7a13f2c7194ed3f9f940a34b262c6b25027))
71
+ * **api:** add new fields ([3d9c69b](https://github.com/Increase/increase-node/commit/3d9c69bddf970739f0b91eb4962a058e9ee756c8))
72
+ * **api:** add new methods ([ca41987](https://github.com/Increase/increase-node/commit/ca41987401784ddb2266bd1a32b08f2f58864ceb))
73
+ * **api:** add optional `pending_transaction_id` field to pending transaction ([fa011e7](https://github.com/Increase/increase-node/commit/fa011e7adb44fb954efa3024b01f88aab3d789ed))
74
+ * **api:** add wire decline object ([2d2e77e](https://github.com/Increase/increase-node/commit/2d2e77eaf2c7244d7491153f32f70aae537a62c9))
75
+ * **api:** enum updates ([f09e25a](https://github.com/Increase/increase-node/commit/f09e25a7e4683beb2779fd76a46c2c629414810b))
76
+ * **api:** make routeType an enum & add ACHTransfer.effectiveDate ([77fd8ea](https://github.com/Increase/increase-node/commit/77fd8ea44236307fb6a8e7d464db55f8e3ba5fd9))
77
+ * **api:** make routeType an enum & add ACHTransfer.effectiveDate ([77fd8ea](https://github.com/Increase/increase-node/commit/77fd8ea44236307fb6a8e7d464db55f8e3ba5fd9))
78
+ * **api:** replace notification_of_change with a list, and add merchant_acceptor_id ([831e49e](https://github.com/Increase/increase-node/commit/831e49e0d1fbf8dd57ea204d89b1be2d69d1ee75))
79
+ * **api:** updates ([ad907d5](https://github.com/Increase/increase-node/commit/ad907d5bf9f6fd2ffe7c8fb89c884d5ba0065593))
80
+ * **api:** updates ([ca80997](https://github.com/Increase/increase-node/commit/ca80997fc7397066ac6149e8db65d6541bf012de))
81
+ * **api:** updates ([ca80997](https://github.com/Increase/increase-node/commit/ca80997fc7397066ac6149e8db65d6541bf012de))
82
+ * **api:** updates ([651bf76](https://github.com/Increase/increase-node/commit/651bf7670c167ffc41eb40c0e226fc76062a4305))
83
+ * **api:** updates ([e58e324](https://github.com/Increase/increase-node/commit/e58e3241015e95afac62550f5b0f1d152dba999b))
84
+ * **client:** handle trailing slash in base url properly ([a03d867](https://github.com/Increase/increase-node/commit/a03d86797fa71036cc45b241a1de1b5edb82e416))
85
+ * **docs:** add more doc comments ([b8bc790](https://github.com/Increase/increase-node/commit/b8bc790a3e06fa3b8a9e6a5299c9e8e1db0b671d))
86
+ * **docs:** updates ([6cea39c](https://github.com/Increase/increase-node/commit/6cea39cd892b2fdae5b7b2a171f9acbcab0e6f62))
87
+ * improve docs and add new property ([418fe83](https://github.com/Increase/increase-node/commit/418fe831af1fcb216ea938930a956b6f1d3083d7))
88
+ * improve error types ([db09c19](https://github.com/Increase/increase-node/commit/db09c19c6017817aba695bffd29c63cf5e31f5f3))
89
+ * improve error types ([db09c19](https://github.com/Increase/increase-node/commit/db09c19c6017817aba695bffd29c63cf5e31f5f3))
90
+ * **internal:** add support for positional params ([9cafda3](https://github.com/Increase/increase-node/commit/9cafda3db2f6d124839dabd66e4997826384d197))
91
+ * **internal:** add support for positional params ([9cafda3](https://github.com/Increase/increase-node/commit/9cafda3db2f6d124839dabd66e4997826384d197))
92
+ * **internal:** improve example generation ([e0fa5b3](https://github.com/Increase/increase-node/commit/e0fa5b3a5654d032d0ff98964ed055a27be4c5e7))
93
+ * **internal:** improve example generation ([e0fa5b3](https://github.com/Increase/increase-node/commit/e0fa5b3a5654d032d0ff98964ed055a27be4c5e7))
94
+ * **internal:** internal fixes ([4848450](https://github.com/Increase/increase-node/commit/4848450f8a0cbfa465097b154ccf866766146490))
95
+ * **internal:** internal fixes ([4848450](https://github.com/Increase/increase-node/commit/4848450f8a0cbfa465097b154ccf866766146490))
96
+ * **internal:** re-export `fileFromPath` helper util from the root ([09c0c79](https://github.com/Increase/increase-node/commit/09c0c795a42f8f15ae6008aa8e6baaaa22261dc2))
97
+ * **internal:** re-export `fileFromPath` helper util from the root ([09c0c79](https://github.com/Increase/increase-node/commit/09c0c795a42f8f15ae6008aa8e6baaaa22261dc2))
98
+ * send Idempotency-Key by default for POST requests ([4c15f76](https://github.com/Increase/increase-node/commit/4c15f76c2f04b92e0dd99045f4f801013c105afc))
99
+ * send Idempotency-Key by default for POST requests ([4c15f76](https://github.com/Increase/increase-node/commit/4c15f76c2f04b92e0dd99045f4f801013c105afc))
100
+ * **tsconfig:** set declarationMap: true ([50c755f](https://github.com/Increase/increase-node/commit/50c755f0f5df98074094175e71670d4f45366fb4))
101
+ * **tsconfig:** set declarationMap: true ([50c755f](https://github.com/Increase/increase-node/commit/50c755f0f5df98074094175e71670d4f45366fb4))
102
+ * update docs ([facb322](https://github.com/Increase/increase-node/commit/facb322b04c7951ea764b7db610902812cf5a7be))
103
+
104
+
105
+ ### Bug Fixes
106
+
107
+ * allow importing in typescript without manually installing @types/web ([d802d9e](https://github.com/Increase/increase-node/commit/d802d9e0d145e1b183d476b47764a48f0de08497))
108
+ * bump @types/node version ([7915638](https://github.com/Increase/increase-node/commit/7915638b2e4302a5ed0b9adc024916fccde742c4))
109
+ * change unknown type generation to `interface{}` ([532c5ec](https://github.com/Increase/increase-node/commit/532c5ec12522300e92b4a05f731f8911a6afd3ec))
110
+ * change unknown type generation to `interface{}` ([532c5ec](https://github.com/Increase/increase-node/commit/532c5ec12522300e92b4a05f731f8911a6afd3ec))
111
+ * **client:** properly expose `maxRetries` option ([dfdce20](https://github.com/Increase/increase-node/commit/dfdce20b7a485d0f15182546f47ae340c6280ae7))
112
+ * **internal:** fix TS error when setting global AbortController polyfill ([00c0df8](https://github.com/Increase/increase-node/commit/00c0df83c4ad058271e7207db244ed12c3fe856d))
113
+ * **internal:** fix TS error when setting global AbortController polyfill ([00c0df8](https://github.com/Increase/increase-node/commit/00c0df83c4ad058271e7207db244ed12c3fe856d))
114
+ * polyfill AbortController more safely ([71e0db3](https://github.com/Increase/increase-node/commit/71e0db32ccd0073e052edf6b33bd170e6c5bf7c8))
115
+ * polyfill AbortController more safely ([71e0db3](https://github.com/Increase/increase-node/commit/71e0db32ccd0073e052edf6b33bd170e6c5bf7c8))
116
+ * **sse:** handle server-sent events more robustly ([8dddf91](https://github.com/Increase/increase-node/commit/8dddf917c64db1623b7f4c756539abfe67ab4dd0))
117
+
118
+
119
+ ### Reverts
120
+
121
+ * remove `crypto` module import ([b82e4b7](https://github.com/Increase/increase-node/commit/b82e4b7b2755d9ae1556a0d2bb9d5f30218e56fd))
122
+ * remove `crypto` module import ([b82e4b7](https://github.com/Increase/increase-node/commit/b82e4b7b2755d9ae1556a0d2bb9d5f30218e56fd))
123
+
124
+
125
+ ### Refactors
126
+
127
+ * **docs:** cleanup api.md response types ([539848e](https://github.com/Increase/increase-node/commit/539848e9001e424f9492f60d82cfb861316cfcb2))
128
+ * remove ability to read the api key from the environment ([3051874](https://github.com/Increase/increase-node/commit/30518740b1c8226ee79d959febb32b517631d0bd))
129
+ * reorganize pagination class definitions ([972a30e](https://github.com/Increase/increase-node/commit/972a30e58fb19c4e46d38dddd2b2acd1288f1e36))
130
+ * reorganize pagination class definitions ([972a30e](https://github.com/Increase/increase-node/commit/972a30e58fb19c4e46d38dddd2b2acd1288f1e36))
package/README.md CHANGED
@@ -70,7 +70,7 @@ import Increase, { fileFromPath } from 'increase';
70
70
 
71
71
  const increase = new Increase();
72
72
 
73
- const file = await fileFromPath('/my/file.txt');
73
+ const file = await fileFromPath('my/file.txt');
74
74
  await increase.files.create({ file: file, purpose: 'other' });
75
75
  ```
76
76
 
@@ -155,7 +155,7 @@ Note that requests which time out will be [retried twice by default](#retries).
155
155
  ## Auto-pagination
156
156
 
157
157
  List methods in the Increase API are paginated.
158
- Use `for await … of` syntax to iterate through items across all pages.
158
+ You can use `for await … of` syntax to iterate through items across all pages:
159
159
 
160
160
  ```ts
161
161
  async function fetchAllAccounts(params) {
@@ -168,6 +168,21 @@ async function fetchAllAccounts(params) {
168
168
  }
169
169
  ```
170
170
 
171
+ Alternatively, you can make request a single page at a time:
172
+
173
+ ```ts
174
+ let page = await increase.accounts.list();
175
+ for (const account of page.data) {
176
+ console.log(account);
177
+ }
178
+
179
+ // Convenience methods are provided for manually paginating:
180
+ while (page.hasNextPage()) {
181
+ page = page.getNextPage();
182
+ // ...
183
+ }
184
+ ```
185
+
171
186
  ## Configuring an HTTP(S) Agent (e.g., for proxies)
172
187
 
173
188
  By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
@@ -197,14 +212,13 @@ This package is in beta. Its internals and interfaces are not stable
197
212
  and subject to change without a major semver bump;
198
213
  please reach out if you rely on any undocumented behavior.
199
214
 
200
- We are keen for your feedback; please email us at [dev-feedback@increase.com](mailto:dev-feedback@increase.com)
201
- or open an issue with questions, bugs, or suggestions.
215
+ We are keen for your feedback; please open an [issue](https://www.github.com/increase/increase-node/issues) with questions, bugs, or suggestions.
202
216
 
203
217
  ## Requirements
204
218
 
205
219
  The following runtimes are supported:
206
220
 
207
- - Node.js version 12 or higher.
221
+ - Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
208
222
  - Deno v1.28.0 or higher (experimental).
209
223
  Use `import Increase from "npm:increase"`.
210
224
 
package/api.md CHANGED
@@ -25,6 +25,37 @@ Methods:
25
25
  - <code title="patch /account_numbers/{account_number_id}">client.accountNumbers.<a href="./resources/account-numbers.ts">update</a>(accountNumberId, { ...params }) -> AccountNumber</code>
26
26
  - <code title="get /account_numbers">client.accountNumbers.<a href="./resources/account-numbers.ts">list</a>({ ...params }) -> AccountNumbersPage</code>
27
27
 
28
+ # BookkeepingAccounts
29
+
30
+ Models:
31
+
32
+ - <code><a href="./resources/bookkeeping-accounts.ts">BookkeepingAccount</a></code>
33
+
34
+ Methods:
35
+
36
+ - <code title="post /bookkeeping_accounts">client.bookkeepingAccounts.<a href="./resources/bookkeeping-accounts.ts">create</a>({ ...params }) -> BookkeepingAccount</code>
37
+ - <code title="get /bookkeeping_accounts">client.bookkeepingAccounts.<a href="./resources/bookkeeping-accounts.ts">list</a>({ ...params }) -> BookkeepingAccountsPage</code>
38
+
39
+ # BookkeepingEntrySets
40
+
41
+ Models:
42
+
43
+ - <code><a href="./resources/bookkeeping-entry-sets.ts">BookkeepingEntrySet</a></code>
44
+
45
+ Methods:
46
+
47
+ - <code title="post /bookkeeping_entry_sets">client.bookkeepingEntrySets.<a href="./resources/bookkeeping-entry-sets.ts">create</a>({ ...params }) -> BookkeepingEntrySet</code>
48
+
49
+ # BookkeepingEntries
50
+
51
+ Models:
52
+
53
+ - <code><a href="./resources/bookkeeping-entries.ts">BookkeepingEntry</a></code>
54
+
55
+ Methods:
56
+
57
+ - <code title="get /bookkeeping_entries">client.bookkeepingEntries.<a href="./resources/bookkeeping-entries.ts">list</a>({ ...params }) -> BookkeepingEntriesPage</code>
58
+
28
59
  # RealTimeDecisions
29
60
 
30
61
  Models:
@@ -36,6 +67,28 @@ Methods:
36
67
  - <code title="get /real_time_decisions/{real_time_decision_id}">client.realTimeDecisions.<a href="./resources/real-time-decisions.ts">retrieve</a>(realTimeDecisionId) -> RealTimeDecision</code>
37
68
  - <code title="post /real_time_decisions/{real_time_decision_id}/action">client.realTimeDecisions.<a href="./resources/real-time-decisions.ts">action</a>(realTimeDecisionId, { ...params }) -> RealTimeDecision</code>
38
69
 
70
+ # RealTimePaymentsTransfers
71
+
72
+ Models:
73
+
74
+ - <code><a href="./resources/real-time-payments-transfers.ts">RealTimePaymentsTransfer</a></code>
75
+
76
+ Methods:
77
+
78
+ - <code title="post /real_time_payments_transfers">client.realTimePaymentsTransfers.<a href="./resources/real-time-payments-transfers.ts">create</a>({ ...params }) -> RealTimePaymentsTransfer</code>
79
+ - <code title="get /real_time_payments_transfers/{real_time_payments_transfer_id}">client.realTimePaymentsTransfers.<a href="./resources/real-time-payments-transfers.ts">retrieve</a>(realTimePaymentsTransferId) -> RealTimePaymentsTransfer</code>
80
+ - <code title="get /real_time_payments_transfers">client.realTimePaymentsTransfers.<a href="./resources/real-time-payments-transfers.ts">list</a>({ ...params }) -> RealTimePaymentsTransfersPage</code>
81
+
82
+ # BalanceLookups
83
+
84
+ Models:
85
+
86
+ - <code><a href="./resources/balance-lookups.ts">BalanceLookupLookupResponse</a></code>
87
+
88
+ Methods:
89
+
90
+ - <code title="post /balance_lookups">client.balanceLookups.<a href="./resources/balance-lookups.ts">lookup</a>({ ...params }) -> BalanceLookupLookupResponse</code>
91
+
39
92
  # Cards
40
93
 
41
94
  Models:
@@ -88,6 +141,18 @@ Methods:
88
141
  - <code title="patch /external_accounts/{external_account_id}">client.externalAccounts.<a href="./resources/external-accounts.ts">update</a>(externalAccountId, { ...params }) -> ExternalAccount</code>
89
142
  - <code title="get /external_accounts">client.externalAccounts.<a href="./resources/external-accounts.ts">list</a>({ ...params }) -> ExternalAccountsPage</code>
90
143
 
144
+ # Exports
145
+
146
+ Models:
147
+
148
+ - <code><a href="./resources/exports.ts">Export</a></code>
149
+
150
+ Methods:
151
+
152
+ - <code title="post /exports">client.exports.<a href="./resources/exports.ts">create</a>({ ...params }) -> Export</code>
153
+ - <code title="get /exports/{export_id}">client.exports.<a href="./resources/exports.ts">retrieve</a>(exportId) -> Export</code>
154
+ - <code title="get /exports">client.exports.<a href="./resources/exports.ts">list</a>({ ...params }) -> ExportsPage</code>
155
+
91
156
  # DigitalWalletTokens
92
157
 
93
158
  Models:
@@ -121,6 +186,17 @@ Methods:
121
186
  - <code title="get /pending_transactions/{pending_transaction_id}">client.pendingTransactions.<a href="./resources/pending-transactions.ts">retrieve</a>(pendingTransactionId) -> PendingTransaction</code>
122
187
  - <code title="get /pending_transactions">client.pendingTransactions.<a href="./resources/pending-transactions.ts">list</a>({ ...params }) -> PendingTransactionsPage</code>
123
188
 
189
+ # Programs
190
+
191
+ Models:
192
+
193
+ - <code><a href="./resources/programs.ts">Program</a></code>
194
+
195
+ Methods:
196
+
197
+ - <code title="get /programs/{program_id}">client.programs.<a href="./resources/programs.ts">retrieve</a>(programId) -> Program</code>
198
+ - <code title="get /programs">client.programs.<a href="./resources/programs.ts">list</a>({ ...params }) -> ProgramsPage</code>
199
+
124
200
  # DeclinedTransactions
125
201
 
126
202
  Models:
@@ -253,9 +329,14 @@ Methods:
253
329
 
254
330
  ## SupplementalDocuments
255
331
 
332
+ Models:
333
+
334
+ - <code><a href="./resources/entities/supplemental-documents.ts">SupplementalDocument</a></code>
335
+
256
336
  Methods:
257
337
 
258
338
  - <code title="post /entities/{entity_id}/supplemental_documents">client.entities.supplementalDocuments.<a href="./resources/entities/supplemental-documents.ts">create</a>(entityId, { ...params }) -> Entity</code>
339
+ - <code title="get /entity_supplemental_documents">client.entities.supplementalDocuments.<a href="./resources/entities/supplemental-documents.ts">list</a>({ ...params }) -> SupplementalDocumentsPage</code>
259
340
 
260
341
  # InboundWireDrawdownRequests
261
342
 
@@ -414,6 +495,7 @@ Methods:
414
495
 
415
496
  - <code title="post /simulations/check_transfers/{check_transfer_id}/deposit">client.simulations.checkTransfers.<a href="./resources/simulations/check-transfers.ts">deposit</a>(checkTransferId) -> CheckTransfer</code>
416
497
  - <code title="post /simulations/check_transfers/{check_transfer_id}/mail">client.simulations.checkTransfers.<a href="./resources/simulations/check-transfers.ts">mail</a>(checkTransferId) -> CheckTransfer</code>
498
+ - <code title="post /simulations/check_transfers/{check_transfer_id}/return">client.simulations.checkTransfers.<a href="./resources/simulations/check-transfers.ts">return</a>(checkTransferId, { ...params }) -> CheckTransfer</code>
417
499
 
418
500
  ## Documents
419
501
 
@@ -439,12 +521,28 @@ Methods:
439
521
  - <code title="post /simulations/check_deposits/{check_deposit_id}/return">client.simulations.checkDeposits.<a href="./resources/simulations/check-deposits.ts">return</a>(checkDepositId) -> CheckDeposit</code>
440
522
  - <code title="post /simulations/check_deposits/{check_deposit_id}/submit">client.simulations.checkDeposits.<a href="./resources/simulations/check-deposits.ts">submit</a>(checkDepositId) -> CheckDeposit</code>
441
523
 
524
+ ## Programs
525
+
526
+ Methods:
527
+
528
+ - <code title="post /simulations/programs">client.simulations.programs.<a href="./resources/simulations/programs.ts">create</a>({ ...params }) -> Program</code>
529
+
442
530
  ## InboundWireDrawdownRequests
443
531
 
444
532
  Methods:
445
533
 
446
534
  - <code title="post /simulations/inbound_wire_drawdown_requests">client.simulations.inboundWireDrawdownRequests.<a href="./resources/simulations/inbound-wire-drawdown-requests.ts">create</a>({ ...params }) -> InboundWireDrawdownRequest</code>
447
535
 
536
+ ## InterestPayments
537
+
538
+ Models:
539
+
540
+ - <code><a href="./resources/simulations/interest-payments.ts">InterestPaymentSimulationResult</a></code>
541
+
542
+ Methods:
543
+
544
+ - <code title="post /simulations/interest_payment">client.simulations.interestPayments.<a href="./resources/simulations/interest-payments.ts">create</a>({ ...params }) -> InterestPaymentSimulationResult</code>
545
+
448
546
  ## WireTransfers
449
547
 
450
548
  Models:
@@ -474,4 +572,5 @@ Models:
474
572
 
475
573
  Methods:
476
574
 
575
+ - <code title="post /simulations/real_time_payments_transfers/{real_time_payments_transfer_id}/complete">client.simulations.realTimePaymentsTransfers.<a href="./resources/simulations/real-time-payments-transfers.ts">complete</a>(realTimePaymentsTransferId, { ...params }) -> RealTimePaymentsTransfer</code>
477
576
  - <code title="post /simulations/inbound_real_time_payments_transfers">client.simulations.realTimePaymentsTransfers.<a href="./resources/simulations/real-time-payments-transfers.ts">createInbound</a>({ ...params }) -> InboundRealTimePaymentsTransferSimulationResult</code>
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+
3
+ errors=()
4
+
5
+ if [ -z "${STAINLESS_API_KEY}" ]; then
6
+ errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organisation secrets on GitHub.")
7
+ fi
8
+
9
+ if [ -z "${NPM_TOKEN}" ]; then
10
+ errors+=("The INCREASE_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organisation secrets")
11
+ fi
12
+
13
+ len=${#errors[@]}
14
+
15
+ if [[ len -gt 0 ]]; then
16
+ echo -e "Found the following errors in the release environment:\n"
17
+
18
+ for error in "${errors[@]}"; do
19
+ echo -e "- $error\n"
20
+ done
21
+
22
+ exit 1
23
+ fi
24
+
25
+ echo "The environment is ready to push releases!"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -eux
4
+
5
+ npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
6
+ yarn publish --build --access public
package/check-version.ts CHANGED
@@ -7,7 +7,10 @@ const main = () => {
7
7
  if (typeof version !== 'string') {
8
8
  throw `Unexpected type for the package.json version field; got ${typeof version}, expected string`;
9
9
  }
10
- fs.writeFileSync('version.ts', `export const VERSION = '${version}';\n`);
10
+
11
+ const contents = fs.readFileSync('version.ts', 'utf8');
12
+ const output = contents.replace(/(export const VERSION = ')(.*)(')/g, `$1${version}$3`);
13
+ fs.writeFileSync('version.ts', output);
11
14
  };
12
15
 
13
16
  if (require.main === module) {
package/core.ts CHANGED
@@ -7,8 +7,12 @@ import { FormDataEncoder } from 'form-data-encoder';
7
7
  import { Readable } from 'stream';
8
8
 
9
9
  import { VERSION } from './version';
10
+ import { Stream } from './streaming';
11
+ import { APIError, APIConnectionError, APIConnectionTimeoutError } from './error';
10
12
  import { Fetch, getDefaultAgent, getFetch } from './fetch-polyfill';
11
13
 
14
+ const MAX_RETRIES = 2;
15
+
12
16
  export abstract class APIClient {
13
17
  baseURL: string;
14
18
  maxRetries: number;
@@ -20,17 +24,17 @@ export abstract class APIClient {
20
24
 
21
25
  constructor({
22
26
  baseURL,
23
- maxRetries = 2,
27
+ maxRetries,
24
28
  timeout = 60 * 1000, // 60s
25
29
  httpAgent,
26
30
  }: {
27
31
  baseURL: string;
28
- maxRetries?: number;
32
+ maxRetries?: number | undefined;
29
33
  timeout: number | undefined;
30
34
  httpAgent: Agent | undefined;
31
35
  }) {
32
36
  this.baseURL = baseURL;
33
- this.maxRetries = validatePositiveInteger('maxRetries', maxRetries);
37
+ this.maxRetries = validatePositiveInteger('maxRetries', maxRetries ?? MAX_RETRIES);
34
38
  this.timeout = validatePositiveInteger('timeout', timeout);
35
39
  this.httpAgent = httpAgent;
36
40
 
@@ -144,11 +148,29 @@ export abstract class APIClient {
144
148
  return { req, url, timeout };
145
149
  }
146
150
 
151
+ /**
152
+ * Used as a callback for mutating the given `RequestInit` object.
153
+ *
154
+ * This is useful for cases where you want to add certain headers based off of
155
+ * the request properties, e.g. `method` or `url`.
156
+ */
157
+ protected async prepareRequest(request: RequestInit, { url }: { url: string }): Promise<void> {}
158
+
159
+ protected makeStatusError(
160
+ status: number | undefined,
161
+ error: Object | undefined,
162
+ message: string | undefined,
163
+ headers: Headers | undefined,
164
+ ) {
165
+ return APIError.generate(status, error, message, headers);
166
+ }
167
+
147
168
  async request<Req extends {}, Rsp>(
148
169
  options: FinalRequestOptions<Req>,
149
170
  retriesRemaining = options.maxRetries ?? this.maxRetries,
150
171
  ): Promise<APIResponse<Rsp>> {
151
172
  const { req, url, timeout } = this.buildRequest(options);
173
+ await this.prepareRequest(req, { url });
152
174
 
153
175
  this.debug('request', url, options, req.headers);
154
176
 
@@ -174,8 +196,7 @@ export abstract class APIClient {
174
196
 
175
197
  this.debug('response', response.status, url, responseHeaders, errMessage);
176
198
 
177
- const err = APIError.generate(response.status, errJSON, errMessage, responseHeaders);
178
-
199
+ const err = this.makeStatusError(response.status, errJSON, errMessage, responseHeaders);
179
200
  throw err;
180
201
  }
181
202
 
@@ -218,7 +239,10 @@ export abstract class APIClient {
218
239
  }
219
240
 
220
241
  buildURL<Req>(path: string, query: Req | undefined): string {
221
- const url = isAbsoluteURL(path) ? new URL(path) : new URL(this.baseURL + path);
242
+ const url =
243
+ isAbsoluteURL(path) ?
244
+ new URL(path)
245
+ : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
222
246
 
223
247
  if (query) {
224
248
  url.search = qs.stringify(query, this.qsOptions());
@@ -454,46 +478,6 @@ export class PagePromise<
454
478
  }
455
479
  }
456
480
 
457
- export class Stream<Item> implements AsyncIterable<Item>, APIResponse<Stream<Item>> {
458
- response: Response;
459
- responseHeaders: Headers;
460
- controller: AbortController;
461
-
462
- constructor(response: Response, controller: AbortController) {
463
- this.response = response;
464
- this.controller = controller;
465
- this.responseHeaders = createResponseHeaders(response.headers);
466
- }
467
-
468
- async *[Symbol.asyncIterator](): AsyncIterator<Item, any, undefined> {
469
- if (!this.response.body) {
470
- this.controller.abort();
471
- throw new Error(`Attempted to iterate over a response with no body`);
472
- }
473
-
474
- for await (const chunk of this.response.body) {
475
- let text;
476
- if (chunk instanceof Buffer) {
477
- text = chunk.toString();
478
- } else {
479
- text = chunk;
480
- }
481
-
482
- if (text.startsWith('data: ')) {
483
- text = text.substring(6);
484
- }
485
-
486
- if (text.startsWith('[DONE]')) {
487
- break;
488
- }
489
-
490
- yield JSON.parse(text);
491
- }
492
-
493
- this.controller.abort();
494
- }
495
- }
496
-
497
481
  export const createResponseHeaders = (
498
482
  headers: Awaited<ReturnType<Fetch>>['headers'],
499
483
  ): Record<string, string> => {
@@ -560,84 +544,6 @@ export type APIResponse<T> = T & {
560
544
  responseHeaders: Headers;
561
545
  };
562
546
 
563
- export class APIError extends Error {
564
- readonly status: number | undefined;
565
- readonly headers: Headers | undefined;
566
- readonly error: Object | undefined;
567
-
568
- constructor(
569
- status: number | undefined,
570
- error: Object | undefined,
571
- message: string | undefined,
572
- headers: Headers | undefined,
573
- ) {
574
- super(message || (error as any)?.message);
575
- this.status = status;
576
- this.headers = headers;
577
- this.error = error;
578
- }
579
-
580
- static generate(
581
- status: number | undefined,
582
- error: Object | undefined,
583
- message: string | undefined,
584
- headers: Headers | undefined,
585
- ) {
586
- if (!status) return new APIConnectionError({ cause: castToError(error) });
587
-
588
- if (status === 400) return new BadRequestError(status, error, message, headers);
589
- if (status === 401) return new AuthenticationError(status, error, message, headers);
590
- if (status === 403) return new PermissionDeniedError(status, error, message, headers);
591
- if (status === 404) return new NotFoundError(status, error, message, headers);
592
- if (status === 409) return new ConflictError(status, error, message, headers);
593
- if (status === 422) return new UnprocessableEntityError(status, error, message, headers);
594
- if (status === 429) return new RateLimitError(status, error, message, headers);
595
- if (status >= 500) return new InternalServerError(status, error, message, headers);
596
-
597
- return new APIError(status, error, message, headers);
598
- }
599
- }
600
-
601
- export class BadRequestError extends APIError {
602
- override readonly status: 400 = 400;
603
- }
604
- export class AuthenticationError extends APIError {
605
- override readonly status: 401 = 401;
606
- }
607
- export class PermissionDeniedError extends APIError {
608
- override readonly status: 403 = 403;
609
- }
610
- export class NotFoundError extends APIError {
611
- override readonly status: 404 = 404;
612
- }
613
- export class ConflictError extends APIError {
614
- override readonly status: 409 = 409;
615
- }
616
- export class UnprocessableEntityError extends APIError {
617
- override readonly status: 422 = 422;
618
- }
619
- export class RateLimitError extends APIError {
620
- override readonly status: 429 = 429;
621
- }
622
- export class InternalServerError extends APIError {}
623
-
624
- export class APIConnectionError extends APIError {
625
- override readonly status: undefined = undefined;
626
-
627
- constructor({ message, cause }: { message?: string; cause?: Error | undefined }) {
628
- super(undefined, undefined, message || 'Connection error.', undefined);
629
- // eslint-disable-next-line
630
- // @ts-ignore
631
- if (cause) this.cause = cause;
632
- }
633
- }
634
-
635
- export class APIConnectionTimeoutError extends APIConnectionError {
636
- constructor() {
637
- super({ message: 'Request timed out.' });
638
- }
639
- }
640
-
641
547
  declare const Deno: any;
642
548
  type Arch = 'x32' | 'x64' | 'arm' | 'arm64' | `other:${string}` | 'unknown';
643
549
  type PlatformName =
@@ -732,7 +638,7 @@ const getPlatformHeaders = () => {
732
638
  return (_platformHeaders ??= getPlatformProperties());
733
639
  };
734
640
 
735
- const safeJSON = (text: string) => {
641
+ export const safeJSON = (text: string) => {
736
642
  try {
737
643
  return JSON.parse(text);
738
644
  } catch (err) {
@@ -758,7 +664,7 @@ const validatePositiveInteger = (name: string, n: number) => {
758
664
  return n;
759
665
  };
760
666
 
761
- const castToError = (err: any): Error => {
667
+ export const castToError = (err: any): Error => {
762
668
  if (err instanceof Error) return err;
763
669
  return new Error(err);
764
670
  };
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=check-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-version.d.ts","sourceRoot":"","sources":["../../check-version.ts"],"names":[],"mappings":""}