conductor-node 11.10.0 → 12.0.0-beta.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 (510) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +201 -21
  3. package/README.md +330 -63
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +914 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +882 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +113 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +97 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +121 -0
  87. package/index.d.ts +121 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +133 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +90 -0
  92. package/index.mjs.map +1 -0
  93. package/internal/qs/formats.d.ts +6 -0
  94. package/internal/qs/formats.d.ts.map +1 -0
  95. package/internal/qs/formats.js +11 -0
  96. package/internal/qs/formats.js.map +1 -0
  97. package/internal/qs/formats.mjs +8 -0
  98. package/internal/qs/formats.mjs.map +1 -0
  99. package/internal/qs/index.d.ts +10 -0
  100. package/internal/qs/index.d.ts.map +1 -0
  101. package/internal/qs/index.js +14 -0
  102. package/internal/qs/index.js.map +1 -0
  103. package/internal/qs/index.mjs +10 -0
  104. package/internal/qs/index.mjs.map +1 -0
  105. package/internal/qs/stringify.d.ts +3 -0
  106. package/internal/qs/stringify.d.ts.map +1 -0
  107. package/internal/qs/stringify.js +280 -0
  108. package/internal/qs/stringify.js.map +1 -0
  109. package/internal/qs/stringify.mjs +276 -0
  110. package/internal/qs/stringify.mjs.map +1 -0
  111. package/internal/qs/types.d.ts +57 -0
  112. package/internal/qs/types.d.ts.map +1 -0
  113. package/{dist/src/resources → internal/qs}/types.js +1 -0
  114. package/internal/qs/types.js.map +1 -0
  115. package/internal/qs/types.mjs +2 -0
  116. package/internal/qs/types.mjs.map +1 -0
  117. package/internal/qs/utils.d.ts +14 -0
  118. package/internal/qs/utils.d.ts.map +1 -0
  119. package/internal/qs/utils.js +229 -0
  120. package/internal/qs/utils.js.map +1 -0
  121. package/internal/qs/utils.mjs +217 -0
  122. package/internal/qs/utils.mjs.map +1 -0
  123. package/package.json +111 -35
  124. package/pagination.d.ts +18 -0
  125. package/pagination.d.ts.map +1 -0
  126. package/pagination.js +40 -0
  127. package/pagination.js.map +1 -0
  128. package/pagination.mjs +36 -0
  129. package/pagination.mjs.map +1 -0
  130. package/resource.d.ts +6 -0
  131. package/resource.d.ts.map +1 -0
  132. package/resource.js +11 -0
  133. package/resource.js.map +1 -0
  134. package/resource.mjs +7 -0
  135. package/resource.mjs.map +1 -0
  136. package/resources/auth-sessions.d.ts +79 -0
  137. package/resources/auth-sessions.d.ts.map +1 -0
  138. package/resources/auth-sessions.js +23 -0
  139. package/resources/auth-sessions.js.map +1 -0
  140. package/resources/auth-sessions.mjs +19 -0
  141. package/resources/auth-sessions.mjs.map +1 -0
  142. package/resources/end-users.d.ts +154 -0
  143. package/resources/end-users.d.ts.map +1 -0
  144. package/resources/end-users.js +48 -0
  145. package/resources/end-users.js.map +1 -0
  146. package/resources/end-users.mjs +44 -0
  147. package/resources/end-users.mjs.map +1 -0
  148. package/resources/index.d.ts +4 -0
  149. package/resources/index.d.ts.map +1 -0
  150. package/resources/index.js +11 -0
  151. package/resources/index.js.map +1 -0
  152. package/resources/index.mjs +5 -0
  153. package/resources/index.mjs.map +1 -0
  154. package/resources/qbd/accounts.d.ts +579 -0
  155. package/resources/qbd/accounts.d.ts.map +1 -0
  156. package/resources/qbd/accounts.js +54 -0
  157. package/resources/qbd/accounts.js.map +1 -0
  158. package/resources/qbd/accounts.mjs +50 -0
  159. package/resources/qbd/accounts.mjs.map +1 -0
  160. package/resources/qbd/bill-check-payments.d.ts +831 -0
  161. package/resources/qbd/bill-check-payments.d.ts.map +1 -0
  162. package/resources/qbd/bill-check-payments.js +70 -0
  163. package/resources/qbd/bill-check-payments.js.map +1 -0
  164. package/resources/qbd/bill-check-payments.mjs +65 -0
  165. package/resources/qbd/bill-check-payments.mjs.map +1 -0
  166. package/resources/qbd/bill-credit-card-payments.d.ts +641 -0
  167. package/resources/qbd/bill-credit-card-payments.d.ts.map +1 -0
  168. package/resources/qbd/bill-credit-card-payments.js +55 -0
  169. package/resources/qbd/bill-credit-card-payments.js.map +1 -0
  170. package/resources/qbd/bill-credit-card-payments.mjs +50 -0
  171. package/resources/qbd/bill-credit-card-payments.mjs.map +1 -0
  172. package/resources/qbd/bills.d.ts +2561 -0
  173. package/resources/qbd/bills.d.ts.map +1 -0
  174. package/resources/qbd/bills.js +69 -0
  175. package/resources/qbd/bills.js.map +1 -0
  176. package/resources/qbd/bills.mjs +64 -0
  177. package/resources/qbd/bills.mjs.map +1 -0
  178. package/resources/qbd/checks.d.ts +2528 -0
  179. package/resources/qbd/checks.d.ts.map +1 -0
  180. package/resources/qbd/checks.js +69 -0
  181. package/resources/qbd/checks.js.map +1 -0
  182. package/resources/qbd/checks.mjs +64 -0
  183. package/resources/qbd/checks.mjs.map +1 -0
  184. package/resources/qbd/classes.d.ts +289 -0
  185. package/resources/qbd/classes.d.ts.map +1 -0
  186. package/resources/qbd/classes.js +54 -0
  187. package/resources/qbd/classes.js.map +1 -0
  188. package/resources/qbd/classes.mjs +50 -0
  189. package/resources/qbd/classes.mjs.map +1 -0
  190. package/resources/qbd/credit-card-charges.d.ts +2236 -0
  191. package/resources/qbd/credit-card-charges.d.ts.map +1 -0
  192. package/resources/qbd/credit-card-charges.js +69 -0
  193. package/resources/qbd/credit-card-charges.js.map +1 -0
  194. package/resources/qbd/credit-card-charges.mjs +64 -0
  195. package/resources/qbd/credit-card-charges.mjs.map +1 -0
  196. package/resources/qbd/credit-card-credits.d.ts +2233 -0
  197. package/resources/qbd/credit-card-credits.d.ts.map +1 -0
  198. package/resources/qbd/credit-card-credits.js +69 -0
  199. package/resources/qbd/credit-card-credits.js.map +1 -0
  200. package/resources/qbd/credit-card-credits.mjs +64 -0
  201. package/resources/qbd/credit-card-credits.mjs.map +1 -0
  202. package/resources/qbd/credit-memos.d.ts +2649 -0
  203. package/resources/qbd/credit-memos.d.ts.map +1 -0
  204. package/resources/qbd/credit-memos.js +69 -0
  205. package/resources/qbd/credit-memos.js.map +1 -0
  206. package/resources/qbd/credit-memos.mjs +64 -0
  207. package/resources/qbd/credit-memos.mjs.map +1 -0
  208. package/resources/qbd/customers.d.ts +2106 -0
  209. package/resources/qbd/customers.d.ts.map +1 -0
  210. package/resources/qbd/customers.js +58 -0
  211. package/resources/qbd/customers.js.map +1 -0
  212. package/resources/qbd/customers.mjs +53 -0
  213. package/resources/qbd/customers.mjs.map +1 -0
  214. package/resources/qbd/date-driven-terms.d.ts +242 -0
  215. package/resources/qbd/date-driven-terms.d.ts.map +1 -0
  216. package/resources/qbd/date-driven-terms.js +43 -0
  217. package/resources/qbd/date-driven-terms.js.map +1 -0
  218. package/resources/qbd/date-driven-terms.mjs +39 -0
  219. package/resources/qbd/date-driven-terms.mjs.map +1 -0
  220. package/resources/qbd/discount-items.d.ts +576 -0
  221. package/resources/qbd/discount-items.d.ts.map +1 -0
  222. package/resources/qbd/discount-items.js +58 -0
  223. package/resources/qbd/discount-items.js.map +1 -0
  224. package/resources/qbd/discount-items.mjs +53 -0
  225. package/resources/qbd/discount-items.mjs.map +1 -0
  226. package/resources/qbd/employees.d.ts +1669 -0
  227. package/resources/qbd/employees.d.ts.map +1 -0
  228. package/resources/qbd/employees.js +58 -0
  229. package/resources/qbd/employees.js.map +1 -0
  230. package/resources/qbd/employees.mjs +53 -0
  231. package/resources/qbd/employees.mjs.map +1 -0
  232. package/resources/qbd/estimates.d.ts +2493 -0
  233. package/resources/qbd/estimates.d.ts.map +1 -0
  234. package/resources/qbd/estimates.js +69 -0
  235. package/resources/qbd/estimates.js.map +1 -0
  236. package/resources/qbd/estimates.mjs +64 -0
  237. package/resources/qbd/estimates.mjs.map +1 -0
  238. package/resources/qbd/index.d.ts +37 -0
  239. package/resources/qbd/index.d.ts.map +1 -0
  240. package/resources/qbd/index.js +105 -0
  241. package/resources/qbd/index.js.map +1 -0
  242. package/resources/qbd/index.mjs +38 -0
  243. package/resources/qbd/index.mjs.map +1 -0
  244. package/resources/qbd/inventory-adjustments.d.ts +814 -0
  245. package/resources/qbd/inventory-adjustments.d.ts.map +1 -0
  246. package/resources/qbd/inventory-adjustments.js +66 -0
  247. package/resources/qbd/inventory-adjustments.js.map +1 -0
  248. package/resources/qbd/inventory-adjustments.mjs +62 -0
  249. package/resources/qbd/inventory-adjustments.mjs.map +1 -0
  250. package/resources/qbd/inventory-assembly-items.d.ts +931 -0
  251. package/resources/qbd/inventory-assembly-items.d.ts.map +1 -0
  252. package/resources/qbd/inventory-assembly-items.js +54 -0
  253. package/resources/qbd/inventory-assembly-items.js.map +1 -0
  254. package/resources/qbd/inventory-assembly-items.mjs +49 -0
  255. package/resources/qbd/inventory-assembly-items.mjs.map +1 -0
  256. package/resources/qbd/inventory-items.d.ts +844 -0
  257. package/resources/qbd/inventory-items.d.ts.map +1 -0
  258. package/resources/qbd/inventory-items.js +58 -0
  259. package/resources/qbd/inventory-items.js.map +1 -0
  260. package/resources/qbd/inventory-items.mjs +53 -0
  261. package/resources/qbd/inventory-items.mjs.map +1 -0
  262. package/resources/qbd/inventory-sites.d.ts +477 -0
  263. package/resources/qbd/inventory-sites.d.ts.map +1 -0
  264. package/resources/qbd/inventory-sites.js +54 -0
  265. package/resources/qbd/inventory-sites.js.map +1 -0
  266. package/resources/qbd/inventory-sites.mjs +50 -0
  267. package/resources/qbd/inventory-sites.mjs.map +1 -0
  268. package/resources/qbd/invoices.d.ts +2873 -0
  269. package/resources/qbd/invoices.d.ts.map +1 -0
  270. package/resources/qbd/invoices.js +69 -0
  271. package/resources/qbd/invoices.js.map +1 -0
  272. package/resources/qbd/invoices.mjs +64 -0
  273. package/resources/qbd/invoices.mjs.map +1 -0
  274. package/resources/qbd/journal-entries.d.ts +856 -0
  275. package/resources/qbd/journal-entries.d.ts.map +1 -0
  276. package/resources/qbd/journal-entries.js +69 -0
  277. package/resources/qbd/journal-entries.js.map +1 -0
  278. package/resources/qbd/journal-entries.mjs +64 -0
  279. package/resources/qbd/journal-entries.mjs.map +1 -0
  280. package/resources/qbd/non-inventory-items.d.ts +950 -0
  281. package/resources/qbd/non-inventory-items.d.ts.map +1 -0
  282. package/resources/qbd/non-inventory-items.js +58 -0
  283. package/resources/qbd/non-inventory-items.js.map +1 -0
  284. package/resources/qbd/non-inventory-items.mjs +53 -0
  285. package/resources/qbd/non-inventory-items.mjs.map +1 -0
  286. package/resources/qbd/payroll-wage-items.d.ts +215 -0
  287. package/resources/qbd/payroll-wage-items.d.ts.map +1 -0
  288. package/resources/qbd/payroll-wage-items.js +47 -0
  289. package/resources/qbd/payroll-wage-items.js.map +1 -0
  290. package/resources/qbd/payroll-wage-items.mjs +42 -0
  291. package/resources/qbd/payroll-wage-items.mjs.map +1 -0
  292. package/resources/qbd/purchase-orders.d.ts +2554 -0
  293. package/resources/qbd/purchase-orders.d.ts.map +1 -0
  294. package/resources/qbd/purchase-orders.js +69 -0
  295. package/resources/qbd/purchase-orders.js.map +1 -0
  296. package/resources/qbd/purchase-orders.mjs +64 -0
  297. package/resources/qbd/purchase-orders.mjs.map +1 -0
  298. package/resources/qbd/qbd.d.ts +146 -0
  299. package/resources/qbd/qbd.d.ts.map +1 -0
  300. package/resources/qbd/qbd.js +202 -0
  301. package/resources/qbd/qbd.js.map +1 -0
  302. package/resources/qbd/qbd.mjs +175 -0
  303. package/resources/qbd/qbd.mjs.map +1 -0
  304. package/resources/qbd/receive-payments.d.ts +1282 -0
  305. package/resources/qbd/receive-payments.d.ts.map +1 -0
  306. package/resources/qbd/receive-payments.js +70 -0
  307. package/resources/qbd/receive-payments.js.map +1 -0
  308. package/resources/qbd/receive-payments.mjs +65 -0
  309. package/resources/qbd/receive-payments.mjs.map +1 -0
  310. package/resources/qbd/sales-orders.d.ts +2628 -0
  311. package/resources/qbd/sales-orders.d.ts.map +1 -0
  312. package/resources/qbd/sales-orders.js +69 -0
  313. package/resources/qbd/sales-orders.js.map +1 -0
  314. package/resources/qbd/sales-orders.mjs +64 -0
  315. package/resources/qbd/sales-orders.mjs.map +1 -0
  316. package/resources/qbd/sales-receipts.d.ts +3373 -0
  317. package/resources/qbd/sales-receipts.d.ts.map +1 -0
  318. package/resources/qbd/sales-receipts.js +69 -0
  319. package/resources/qbd/sales-receipts.js.map +1 -0
  320. package/resources/qbd/sales-receipts.mjs +64 -0
  321. package/resources/qbd/sales-receipts.mjs.map +1 -0
  322. package/resources/qbd/sales-representatives.d.ts +251 -0
  323. package/resources/qbd/sales-representatives.d.ts.map +1 -0
  324. package/resources/qbd/sales-representatives.js +54 -0
  325. package/resources/qbd/sales-representatives.js.map +1 -0
  326. package/resources/qbd/sales-representatives.mjs +50 -0
  327. package/resources/qbd/sales-representatives.mjs.map +1 -0
  328. package/resources/qbd/sales-tax-codes.d.ts +306 -0
  329. package/resources/qbd/sales-tax-codes.d.ts.map +1 -0
  330. package/resources/qbd/sales-tax-codes.js +54 -0
  331. package/resources/qbd/sales-tax-codes.js.map +1 -0
  332. package/resources/qbd/sales-tax-codes.mjs +50 -0
  333. package/resources/qbd/sales-tax-codes.mjs.map +1 -0
  334. package/resources/qbd/sales-tax-items.d.ts +458 -0
  335. package/resources/qbd/sales-tax-items.d.ts.map +1 -0
  336. package/resources/qbd/sales-tax-items.js +58 -0
  337. package/resources/qbd/sales-tax-items.js.map +1 -0
  338. package/resources/qbd/sales-tax-items.mjs +53 -0
  339. package/resources/qbd/sales-tax-items.mjs.map +1 -0
  340. package/resources/qbd/service-items.d.ts +923 -0
  341. package/resources/qbd/service-items.d.ts.map +1 -0
  342. package/resources/qbd/service-items.js +58 -0
  343. package/resources/qbd/service-items.js.map +1 -0
  344. package/resources/qbd/service-items.mjs +53 -0
  345. package/resources/qbd/service-items.mjs.map +1 -0
  346. package/resources/qbd/standard-terms.d.ts +225 -0
  347. package/resources/qbd/standard-terms.d.ts.map +1 -0
  348. package/resources/qbd/standard-terms.js +43 -0
  349. package/resources/qbd/standard-terms.js.map +1 -0
  350. package/resources/qbd/standard-terms.mjs +39 -0
  351. package/resources/qbd/standard-terms.mjs.map +1 -0
  352. package/resources/qbd/subtotal-items.d.ts +323 -0
  353. package/resources/qbd/subtotal-items.d.ts.map +1 -0
  354. package/resources/qbd/subtotal-items.js +58 -0
  355. package/resources/qbd/subtotal-items.js.map +1 -0
  356. package/resources/qbd/subtotal-items.mjs +53 -0
  357. package/resources/qbd/subtotal-items.mjs.map +1 -0
  358. package/resources/qbd/transfers.d.ts +269 -0
  359. package/resources/qbd/transfers.d.ts.map +1 -0
  360. package/resources/qbd/transfers.js +58 -0
  361. package/resources/qbd/transfers.js.map +1 -0
  362. package/resources/qbd/transfers.mjs +53 -0
  363. package/resources/qbd/transfers.mjs.map +1 -0
  364. package/resources/qbd/vendor-credits.d.ts +2298 -0
  365. package/resources/qbd/vendor-credits.d.ts.map +1 -0
  366. package/resources/qbd/vendor-credits.js +69 -0
  367. package/resources/qbd/vendor-credits.js.map +1 -0
  368. package/resources/qbd/vendor-credits.mjs +64 -0
  369. package/resources/qbd/vendor-credits.mjs.map +1 -0
  370. package/resources/qbd/vendors.d.ts +1677 -0
  371. package/resources/qbd/vendors.d.ts.map +1 -0
  372. package/resources/qbd/vendors.js +58 -0
  373. package/resources/qbd/vendors.js.map +1 -0
  374. package/resources/qbd/vendors.mjs +53 -0
  375. package/resources/qbd/vendors.mjs.map +1 -0
  376. package/shims/node.d.ts +30 -0
  377. package/shims/node.d.ts.map +1 -0
  378. package/shims/node.js +31 -0
  379. package/shims/node.js.map +1 -0
  380. package/shims/node.mjs +5 -0
  381. package/shims/node.mjs.map +1 -0
  382. package/shims/web.d.ts +26 -0
  383. package/shims/web.d.ts.map +1 -0
  384. package/shims/web.js +31 -0
  385. package/shims/web.js.map +1 -0
  386. package/shims/web.mjs +5 -0
  387. package/shims/web.mjs.map +1 -0
  388. package/src/_shims/MultipartBody.ts +9 -0
  389. package/src/_shims/README.md +46 -0
  390. package/src/_shims/auto/runtime-bun.ts +4 -0
  391. package/src/_shims/auto/runtime-node.ts +4 -0
  392. package/src/_shims/auto/runtime.ts +4 -0
  393. package/src/_shims/auto/types-node.ts +4 -0
  394. package/src/_shims/auto/types.d.ts +101 -0
  395. package/src/_shims/auto/types.js +3 -0
  396. package/src/_shims/auto/types.mjs +3 -0
  397. package/src/_shims/bun-runtime.ts +14 -0
  398. package/src/_shims/index.d.ts +81 -0
  399. package/src/_shims/index.js +13 -0
  400. package/src/_shims/index.mjs +7 -0
  401. package/src/_shims/manual-types.d.ts +12 -0
  402. package/src/_shims/manual-types.js +3 -0
  403. package/src/_shims/manual-types.mjs +3 -0
  404. package/src/_shims/node-runtime.ts +81 -0
  405. package/src/_shims/node-types.d.ts +42 -0
  406. package/src/_shims/node-types.js +3 -0
  407. package/src/_shims/node-types.mjs +3 -0
  408. package/src/_shims/registry.ts +67 -0
  409. package/src/_shims/web-runtime.ts +103 -0
  410. package/src/_shims/web-types.d.ts +83 -0
  411. package/src/_shims/web-types.js +3 -0
  412. package/src/_shims/web-types.mjs +3 -0
  413. package/src/core.ts +1208 -0
  414. package/src/error.ts +130 -0
  415. package/src/index.ts +227 -0
  416. package/src/internal/qs/LICENSE.md +13 -0
  417. package/src/internal/qs/README.md +3 -0
  418. package/src/internal/qs/formats.ts +9 -0
  419. package/src/internal/qs/index.ts +13 -0
  420. package/src/internal/qs/stringify.ts +388 -0
  421. package/src/internal/qs/types.ts +71 -0
  422. package/src/internal/qs/utils.ts +265 -0
  423. package/src/lib/.keep +4 -0
  424. package/src/pagination.ts +60 -0
  425. package/src/resource.ts +11 -0
  426. package/src/resources/auth-sessions.ts +99 -0
  427. package/src/resources/end-users.ts +216 -0
  428. package/src/resources/index.ts +14 -0
  429. package/src/resources/qbd/accounts.ts +797 -0
  430. package/src/resources/qbd/bill-check-payments.ts +1086 -0
  431. package/src/resources/qbd/bill-credit-card-payments.ts +851 -0
  432. package/src/resources/qbd/bills.ts +3039 -0
  433. package/src/resources/qbd/checks.ts +3003 -0
  434. package/src/resources/qbd/classes.ts +366 -0
  435. package/src/resources/qbd/credit-card-charges.ts +2646 -0
  436. package/src/resources/qbd/credit-card-credits.ts +2643 -0
  437. package/src/resources/qbd/credit-memos.ts +3157 -0
  438. package/src/resources/qbd/customers.ts +2518 -0
  439. package/src/resources/qbd/date-driven-terms.ts +314 -0
  440. package/src/resources/qbd/discount-items.ts +712 -0
  441. package/src/resources/qbd/employees.ts +2266 -0
  442. package/src/resources/qbd/estimates.ts +2975 -0
  443. package/src/resources/qbd/index.ts +346 -0
  444. package/src/resources/qbd/inventory-adjustments.ts +1008 -0
  445. package/src/resources/qbd/inventory-assembly-items.ts +1126 -0
  446. package/src/resources/qbd/inventory-items.ts +1026 -0
  447. package/src/resources/qbd/inventory-sites.ts +605 -0
  448. package/src/resources/qbd/invoices.ts +3398 -0
  449. package/src/resources/qbd/journal-entries.ts +1051 -0
  450. package/src/resources/qbd/non-inventory-items.ts +1138 -0
  451. package/src/resources/qbd/payroll-wage-items.ts +304 -0
  452. package/src/resources/qbd/purchase-orders.ts +3045 -0
  453. package/src/resources/qbd/qbd.ts +876 -0
  454. package/src/resources/qbd/receive-payments.ts +1609 -0
  455. package/src/resources/qbd/sales-orders.ts +3141 -0
  456. package/src/resources/qbd/sales-receipts.ts +3977 -0
  457. package/src/resources/qbd/sales-representatives.ts +340 -0
  458. package/src/resources/qbd/sales-tax-codes.ts +398 -0
  459. package/src/resources/qbd/sales-tax-items.ts +583 -0
  460. package/src/resources/qbd/service-items.ts +1105 -0
  461. package/src/resources/qbd/standard-terms.ts +295 -0
  462. package/src/resources/qbd/subtotal-items.ts +430 -0
  463. package/src/resources/qbd/transfers.ts +359 -0
  464. package/src/resources/qbd/vendor-credits.ts +2742 -0
  465. package/src/resources/qbd/vendors.ts +2017 -0
  466. package/src/shims/node.ts +50 -0
  467. package/src/shims/web.ts +50 -0
  468. package/src/tsconfig.json +11 -0
  469. package/src/uploads.ts +255 -0
  470. package/src/version.ts +1 -0
  471. package/uploads.d.ts +75 -0
  472. package/uploads.d.ts.map +1 -0
  473. package/uploads.js +171 -0
  474. package/uploads.js.map +1 -0
  475. package/uploads.mjs +158 -0
  476. package/uploads.mjs.map +1 -0
  477. package/version.d.ts +2 -0
  478. package/version.d.ts.map +1 -0
  479. package/version.js +5 -0
  480. package/version.js.map +1 -0
  481. package/version.mjs +2 -0
  482. package/version.mjs.map +1 -0
  483. package/dist/package.json +0 -48
  484. package/dist/src/Client.d.ts +0 -21
  485. package/dist/src/Client.js +0 -54
  486. package/dist/src/index.d.ts +0 -11
  487. package/dist/src/index.js +0 -59
  488. package/dist/src/integrations/BaseIntegration.d.ts +0 -9
  489. package/dist/src/integrations/BaseIntegration.js +0 -14
  490. package/dist/src/integrations/qbd/QbdIntegration.d.ts +0 -3120
  491. package/dist/src/integrations/qbd/QbdIntegration.js +0 -3147
  492. package/dist/src/integrations/qbd/qbdTypes.d.ts +0 -14076
  493. package/dist/src/integrations/qbd/qbdTypes.js +0 -2
  494. package/dist/src/interceptors/errorHandling.d.ts +0 -2
  495. package/dist/src/interceptors/errorHandling.js +0 -53
  496. package/dist/src/interceptors/logging.d.ts +0 -18
  497. package/dist/src/interceptors/logging.js +0 -70
  498. package/dist/src/resources/AuthSessionsResource.d.ts +0 -77
  499. package/dist/src/resources/AuthSessionsResource.js +0 -26
  500. package/dist/src/resources/BaseResource.d.ts +0 -6
  501. package/dist/src/resources/BaseResource.js +0 -9
  502. package/dist/src/resources/EndUsersResource.d.ts +0 -84
  503. package/dist/src/resources/EndUsersResource.js +0 -57
  504. package/dist/src/resources/types.d.ts +0 -40
  505. package/dist/src/utils/checkForUpdates.d.ts +0 -2
  506. package/dist/src/utils/checkForUpdates.js +0 -62
  507. package/dist/src/utils/env.d.ts +0 -1
  508. package/dist/src/utils/env.js +0 -15
  509. package/dist/src/utils/error.d.ts +0 -184
  510. package/dist/src/utils/error.js +0 -254
package/README.md CHANGED
@@ -6,109 +6,376 @@
6
6
  <img alt="Conductor logo" src="https://github.com/conductor-is/quickbooks-desktop-api/assets/170023/d67464b8-53a7-4d33-afeb-05a2efde1fa8" width="325">
7
7
  </picture>
8
8
  </a>
9
- <h3>QuickBooks Desktop API for Python, Node.js, TypeScript, and REST</h3>
9
+ <h3>QuickBooks Desktop/Enterprise real-time API for Python, Node.js, and REST</h3>
10
10
  <a href="https://docs.conductor.is/quickstart">Quickstart</a>
11
11
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
12
12
  <a href="https://conductor.is">Website</a>
13
13
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
14
14
  <a href="https://docs.conductor.is">Docs</a>
15
15
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
16
- <a href="https://docs.conductor.is/qbd-examples">Examples</a>
17
- <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
18
- <a href="https://twitter.com/conductor_is">Twitter</a>
16
+ <a href="https://docs.conductor.is/qbd-api">Examples</a>
19
17
  <br />
20
18
  <br />
21
19
  <a href="https://npmjs.com/package/conductor-node"><img src="https://img.shields.io/npm/dm/conductor-node.svg?logo=npm" alt="NPM download count"></a>
22
20
  <a href="https://npmjs.org/package/conductor-node"><img src="https://img.shields.io/npm/v/conductor-node.svg?logo=npm" alt="Package version"></a>
21
+ <a href="https://npmjs.org/package/conductor-node"><img src="https://img.shields.io/bundlephobia/minzip/conductor-node" alt="NPM bundle size"></a>
23
22
  <img src="https://img.shields.io/badge/coverage-100%25-brightgreen" alt="Code coverage">
24
23
  <a href="LICENSE"><img src="https://img.shields.io/npm/l/conductor-node.svg?color=blue&logo=github" alt="License" /></a>
25
24
  <hr />
26
25
  </div>
27
26
 
28
- ## What is Conductor?
27
+ [Conductor](https://conductor.is) is a real-time, fully-typed API for **QuickBooks Desktop** (sometimes called QuickBooks Enterprise). In just a few lines, get real-time access to fetch, create, or update _any_ QuickBooks Desktop object type and receive a fully-typed response.
29
28
 
30
- Conductor is a real-time, fully-typed API for **QuickBooks Desktop** (sometimes called QuickBooks Enterprise), available via Python, Node.js, TypeScript, and REST. In just a few lines, get real-time access to fetch, create, or update [_any_ QuickBooks Desktop object type](https://docs.conductor.is/qbd/api#supported-object-types) and receive a fully-typed response. Check out [the documentation](https://docs.conductor.is) to get started.
29
+ **Follow our [Quickstart guide](https://docs.conductor.is/quickstart) to get started.**
31
30
 
32
- Conductor, the company, is building a data integration platform for vertical SaaS companies, starting with QuickBooks Desktop. Our team has spent over a decade building companies, scaling vast software systems, and obsessing over quality.
31
+ This repository is for the Node.js (TypeScript/JavaScript) library. For Python, see [conductor-python](https://github.com/conductor-is/quickbooks-desktop-python).
33
32
 
34
- <!-- markdownlint-disable MD033 -->
35
- <div align="center">
36
- <a href="https://docs.conductor.is"><img src="https://user-images.githubusercontent.com/170023/213273732-83dd6881-0b36-4787-820b-bd55cdc8444f.jpg" alt="QuickBooks Desktop autocomplete" width="600" style="border-radius: 20px;" /></a>
37
- </div>
33
+ ## Installation
34
+
35
+ ```sh
36
+ npm install conductor-node@beta
37
+ ```
38
+
39
+ This version of the library is in beta, but it **_is_ stable and ready for production use**. We merely have a few more endpoints to migrate before prompting all existing users to update.
40
+
41
+ > [!NOTE]
42
+ > If migrating from the old `conductor-node` package, see the [migration guide](https://docs.conductor.is/qbd-api/upgrade-node).
38
43
 
39
44
  ## Key features
40
45
 
41
- - **Any data type:** Query, create, or update any QuickBooks Desktop data type.
42
- - **Real-time**: Get real-time updates on your QuickBooks Desktop data. No queues, no polling.
43
- - **Modern API:** JSON-based REST API, replacing the old XML-based SOAP model.
44
- - **Typed client libraries:** Fully typed libraries in Node.js and Python with autocomplete, inline docs, and type validation for endpoints, parameters, and responses.
45
- - **Request handling:** Invisibly manages queues, timeouts, retries, and pagination.
46
- - **Multi-company support:** Connects to multiple QuickBooks Desktop company files.
47
- - **Validation:** Sanitizes and validates all inputs and outputs.
48
- - **Unified error handling:** Streamlines error handling across the QuickBooks stack.
49
- - **Authentication flow UI:** Simple UI for securely connecting QuickBooks Desktop accounts.
46
+ - **Any data type**: Query, create, or update any QuickBooks Desktop data type.
47
+ - **Real-time**: Get real-time updates on your QuickBooks Desktop data. No queues, no jobs, no cache layer -- just direct access to the data.
48
+ - **Modern API**: JSON-based REST API, replacing the old XML-based SOAP model.
49
+ - **Typed client libraries**: Fully typed libraries in Node.js and Python with autocomplete, inline docs, and type validation for endpoints, parameters, and responses.
50
+ - **Request handling**: Invisibly manages queues, timeouts, retries, and pagination.
51
+ - **Auto-pagination**: Automatically handles paginated responses to retrieve complete datasets.
52
+ - **Multi-company support**: Connects to multiple QuickBooks Desktop company files.
53
+ - **Validation**: Sanitizes and validates all inputs and outputs.
54
+ - **Unified error handling**: Streamlines error handling across the QuickBooks stack.
55
+ - **Authentication flow UI**: Simple UI for securely connecting QuickBooks Desktop accounts.
50
56
  - **Dashboard**: UI to monitor and manage your QuickBooks Desktop connections and data.
51
- - **Error resolution:** Detailed guides and instructions for resolving errors and handling edge cases.
52
-
53
- ## What is this repo?
57
+ - **Error resolution**: Detailed guides and instructions for resolving errors and handling edge cases.
54
58
 
55
- This repository is a library for conveniently accessing Conductor's QuickBooks Desktop API from TypeScript or JavaScript. The library is a wrapper around the Conductor REST API, providing a fully-typed, easy-to-use interface for fetching, creating, and updating QuickBooks Desktop objects.
59
+ ## Usage
56
60
 
57
- ## Requirements
61
+ The full API of this library can be found with code samples at [docs.conductor.is/qbd-api](https://docs.conductor.is/qbd-api).
58
62
 
59
- 1. A Conductor account. Sign up [here](https://dashboard.conductor.is/sign-up).
60
- 2. A QuickBooks Desktop instance for testing. If you don't have one, you can [create a free test instance](https://docs.conductor.is/qbd/test-instance).
63
+ <!-- prettier-ignore -->
64
+ ```js
65
+ import Conductor from 'conductor-node';
61
66
 
62
- ## Documentation
67
+ const client = new Conductor({
68
+ apiKey: process.env['CONDUCTOR_SECRET_KEY'], // This is the default and can be omitted
69
+ });
63
70
 
64
- 1. [Quickstart](https://docs.conductor.is/quickstart)
65
- 2. [Node.js / TypeScript API](https://docs.conductor.is/qbd/api)
66
- 3. [API Reference](https://docs.conductor.is/apis)
67
- 4. [Error Handling](https://docs.conductor.is/usage/error-handling)
71
+ async function main() {
72
+ const page = await client.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' });
73
+ const invoice = page.data[0];
68
74
 
69
- ## Installation
75
+ console.log(invoice.id);
76
+ }
70
77
 
71
- ```sh
72
- npm install conductor-node
73
- # or
74
- yarn add conductor-node
78
+ main();
75
79
  ```
76
80
 
77
- ## Usage
81
+ ### Request & Response types
78
82
 
79
- The full API documentation is available [here](https://docs.conductor.is) along with many code examples. The following is a quickstart example:
83
+ This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
80
84
 
85
+ <!-- prettier-ignore -->
81
86
  ```ts
82
- import Conductor from "conductor-node";
87
+ import Conductor from 'conductor-node';
83
88
 
84
- const conductor = new Conductor("{{YOUR_SECRET_KEY}}");
89
+ const client = new Conductor({
90
+ apiKey: process.env['CONDUCTOR_SECRET_KEY'], // This is the default and can be omitted
91
+ });
85
92
 
86
93
  async function main() {
87
- // 1. Create a new EndUser.
88
- const endUser = await conductor.endUsers.create({
89
- companyName: "{{END_USER_COMPANY_NAME}}",
90
- sourceId: "{{UNIQUE_ID_FROM_YOUR_DB}}",
91
- email: "{{END_USER_EMAIL}}",
92
- });
93
- console.log("Save this EndUser ID to auth future requests:", endUser.id);
94
-
95
- // 2. Create an AuthSession to establish the QuickBooks Desktop connection.
96
- const authSession = await conductor.authSessions.create({
97
- publishableKey: "{{YOUR_PUBLISHABLE_KEY}}",
98
- endUserId: endUser.id,
99
- });
100
- console.log("Complete the QuickBooks Desktop auth:", authSession.authFlowUrl);
101
-
102
- // 3. Get a list of invoices from this EndUser's QuickBooks Desktop.
103
- const qbdInvoices = await conductor.qbd.customer.query(endUser.id, {
104
- MaxReturned: 10,
105
- });
106
- console.log("QuickBooks Desktop invoices:", qbdInvoices);
94
+ const params: Conductor.Qbd.InvoiceListParams = { conductorEndUserId: 'YOUR_END_USER_ID' };
95
+ const [invoice]: [Conductor.Qbd.Invoice] = await client.qbd.invoices.list(params);
107
96
  }
108
97
 
109
98
  main();
110
99
  ```
111
100
 
112
- ## More documentation
101
+ Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
102
+
103
+ ## Handling errors
104
+
105
+ When the library is unable to connect to the API,
106
+ or if the API returns a non-success status code (i.e., 4xx or 5xx response),
107
+ a subclass of `APIError` will be thrown:
108
+
109
+ <!-- prettier-ignore -->
110
+ ```ts
111
+ async function main() {
112
+ const page = await client.qbd.invoices
113
+ .list({ conductorEndUserId: 'YOUR_END_USER_ID' })
114
+ .catch(async (err) => {
115
+ if (err instanceof Conductor.APIError) {
116
+ console.log(err.status); // 400
117
+ console.log(err.name); // BadRequestError
118
+ console.log(err.headers); // {server: 'nginx', ...}
119
+ } else {
120
+ throw err;
121
+ }
122
+ });
123
+ }
124
+
125
+ main();
126
+ ```
127
+
128
+ Error codes are as followed:
129
+
130
+ | Status Code | Error Type |
131
+ | ----------- | -------------------------- |
132
+ | 400 | `BadRequestError` |
133
+ | 401 | `AuthenticationError` |
134
+ | 403 | `PermissionDeniedError` |
135
+ | 404 | `NotFoundError` |
136
+ | 422 | `UnprocessableEntityError` |
137
+ | 429 | `RateLimitError` |
138
+ | >=500 | `InternalServerError` |
139
+ | N/A | `APIConnectionError` |
140
+
141
+ ### Retries
142
+
143
+ Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
144
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
145
+ 429 Rate Limit, and >=500 Internal errors will all be retried by default.
146
+
147
+ You can use the `maxRetries` option to configure or disable this:
148
+
149
+ <!-- prettier-ignore -->
150
+ ```js
151
+ // Configure the default for all requests:
152
+ const client = new Conductor({
153
+ maxRetries: 0, // default is 2
154
+ });
155
+
156
+ // Or, configure per-request:
157
+ await client.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' }, {
158
+ maxRetries: 5,
159
+ });
160
+ ```
161
+
162
+ ### Timeouts
163
+
164
+ Requests time out after 2 minutes by default. You can configure this with a `timeout` option:
165
+
166
+ <!-- prettier-ignore -->
167
+ ```ts
168
+ // Configure the default for all requests:
169
+ const client = new Conductor({
170
+ timeout: 20 * 1000, // 20 seconds (default is 2 minutes)
171
+ });
172
+
173
+ // Override per-request:
174
+ await client.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' }, {
175
+ timeout: 5 * 1000,
176
+ });
177
+ ```
178
+
179
+ On timeout, an `APIConnectionTimeoutError` is thrown.
180
+
181
+ Note that requests which time out will be [retried twice by default](#retries).
182
+
183
+ ## Auto-pagination
184
+
185
+ List methods in the Conductor API are paginated.
186
+ You can use the `for await … of` syntax to iterate through items across all pages:
187
+
188
+ ```ts
189
+ async function fetchAllQbdInvoices(params) {
190
+ const allQbdInvoices = [];
191
+ // Automatically fetches more pages as needed.
192
+ for await (const invoice of client.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' })) {
193
+ allQbdInvoices.push(invoice);
194
+ }
195
+ return allQbdInvoices;
196
+ }
197
+ ```
198
+
199
+ Alternatively, you can request a single page at a time:
200
+
201
+ ```ts
202
+ let page = await client.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' });
203
+ for (const invoice of page.data) {
204
+ console.log(invoice);
205
+ }
206
+
207
+ // Convenience methods are provided for manually paginating:
208
+ while (page.hasNextPage()) {
209
+ page = await page.getNextPage();
210
+ // ...
211
+ }
212
+ ```
213
+
214
+ ## Advanced Usage
215
+
216
+ ### Accessing raw Response data (e.g., headers)
217
+
218
+ The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
219
+
220
+ You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
221
+
222
+ <!-- prettier-ignore -->
223
+ ```ts
224
+ const client = new Conductor();
225
+
226
+ const response = await client.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' }).asResponse();
227
+ console.log(response.headers.get('X-My-Header'));
228
+ console.log(response.statusText); // access the underlying Response object
229
+
230
+ const { data: page, response: raw } = await client.qbd.invoices
231
+ .list({ conductorEndUserId: 'YOUR_END_USER_ID' })
232
+ .withResponse();
233
+ console.log(raw.headers.get('X-My-Header'));
234
+ for await (const invoice of page) {
235
+ console.log(invoice.id);
236
+ }
237
+ ```
238
+
239
+ ### Making custom/undocumented requests
240
+
241
+ This library is typed for convenient access to the documented API. If you need to access undocumented
242
+ endpoints, params, or response properties, the library can still be used.
243
+
244
+ #### Undocumented endpoints
245
+
246
+ To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
247
+ Options on the client, such as retries, will be respected when making these requests.
248
+
249
+ ```ts
250
+ await client.post('/some/path', {
251
+ body: { some_prop: 'foo' },
252
+ query: { some_query_arg: 'bar' },
253
+ });
254
+ ```
255
+
256
+ #### Undocumented request params
257
+
258
+ To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
259
+ parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
260
+ send will be sent as-is.
261
+
262
+ ```ts
263
+ client.foo.create({
264
+ foo: 'my_param',
265
+ bar: 12,
266
+ // @ts-expect-error baz is not yet public
267
+ baz: 'undocumented option',
268
+ });
269
+ ```
270
+
271
+ For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
272
+ extra param in the body.
273
+
274
+ If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
275
+ options.
276
+
277
+ #### Undocumented response properties
278
+
279
+ To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
280
+ the response object, or cast the response object to the requisite type. Like the request params, we do not
281
+ validate or strip extra properties from the response from the API.
282
+
283
+ ### Customizing the fetch client
284
+
285
+ By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
286
+
287
+ If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
288
+ (for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
289
+ add the following import before your first import `from "Conductor"`:
290
+
291
+ ```ts
292
+ // Tell TypeScript and the package to use the global web fetch instead of node-fetch.
293
+ // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
294
+ import 'conductor-node/shims/web';
295
+ import Conductor from 'conductor-node';
296
+ ```
297
+
298
+ To do the inverse, add `import "conductor-node/shims/node"` (which does import polyfills).
299
+ This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/conductor-is/quickbooks-desktop-node/tree/main/src/_shims#readme)).
300
+
301
+ ### Logging and middleware
302
+
303
+ You may also provide a custom `fetch` function when instantiating the client,
304
+ which can be used to inspect or alter the `Request` or `Response` before/after each request:
305
+
306
+ ```ts
307
+ import { fetch } from 'undici'; // as one example
308
+ import Conductor from 'conductor-node';
309
+
310
+ const client = new Conductor({
311
+ fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
312
+ console.log('About to make a request', url, init);
313
+ const response = await fetch(url, init);
314
+ console.log('Got response', response);
315
+ return response;
316
+ },
317
+ });
318
+ ```
319
+
320
+ Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically.
321
+ This is intended for debugging purposes only and may change in the future without notice.
322
+
323
+ ### Configuring an HTTP(S) Agent (e.g., for proxies)
324
+
325
+ 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.
326
+
327
+ If you would like to disable or customize this behavior, for example to use the API behind a proxy, you can pass an `httpAgent` which is used for all requests (be they http or https), for example:
328
+
329
+ <!-- prettier-ignore -->
330
+ ```ts
331
+ import http from 'http';
332
+ import { HttpsProxyAgent } from 'https-proxy-agent';
333
+
334
+ // Configure the default for all requests:
335
+ const client = new Conductor({
336
+ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
337
+ });
338
+
339
+ // Override per-request:
340
+ await client.qbd.invoices.list(
341
+ { conductorEndUserId: 'YOUR_END_USER_ID' },
342
+ {
343
+ httpAgent: new http.Agent({ keepAlive: false }),
344
+ },
345
+ );
346
+ ```
347
+
348
+ ## Semantic versioning
349
+
350
+ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
351
+
352
+ 1. Changes that only affect static types, without breaking runtime behavior.
353
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
354
+ 3. Changes that we do not expect to impact the vast majority of users in practice.
355
+
356
+ We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
357
+
358
+ We are keen for your feedback; please open an [issue](https://www.github.com/conductor-is/quickbooks-desktop-node/issues) with questions, bugs, or suggestions.
359
+
360
+ ## Requirements
361
+
362
+ TypeScript >= 4.5 is supported.
363
+
364
+ The following runtimes are supported:
365
+
366
+ - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
367
+ - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
368
+ - Deno v1.28.0 or higher.
369
+ - Bun 1.0 or later.
370
+ - Cloudflare Workers.
371
+ - Vercel Edge Runtime.
372
+ - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
373
+ - Nitro v2.6 or greater.
374
+
375
+ Note that React Native is not supported at this time.
376
+
377
+ If you are interested in other runtime environments, please open or upvote an issue on GitHub.
378
+
379
+ ## Contributing
113
380
 
114
- Please see our [full documentation site](https://docs.conductor.is) for more docs, guides, and code examples.
381
+ See [the contributing documentation](./CONTRIBUTING.md).
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export declare class MultipartBody {
5
+ body: any;
6
+ constructor(body: any);
7
+ get [Symbol.toStringTag](): string;
8
+ }
9
+ //# sourceMappingURL=MultipartBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.d.ts","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,GAAG;gBAAT,IAAI,EAAE,GAAG;IAC5B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultipartBody = void 0;
4
+ /**
5
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
6
+ */
7
+ class MultipartBody {
8
+ constructor(body) {
9
+ this.body = body;
10
+ }
11
+ get [Symbol.toStringTag]() {
12
+ return 'MultipartBody';
13
+ }
14
+ }
15
+ exports.MultipartBody = MultipartBody;
16
+ //# sourceMappingURL=MultipartBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.js","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AALD,sCAKC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export class MultipartBody {
5
+ constructor(body) {
6
+ this.body = body;
7
+ }
8
+ get [Symbol.toStringTag]() {
9
+ return 'MultipartBody';
10
+ }
11
+ }
12
+ //# sourceMappingURL=MultipartBody.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.mjs","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ # 👋 Wondering what everything in here does?
2
+
3
+ `conductor-node` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
4
+ edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
5
+
6
+ To do this, `conductor-node` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
7
+
8
+ It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
9
+ automatically select the correct shims for each environment. However, conditional exports are a fairly new
10
+ feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
11
+
12
+ setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
13
+ Unfortunately that's still the default setting, and it can result in errors like
14
+ getting the wrong raw `Response` type from `.asResponse()`, for example.
15
+
16
+ The user can work around these issues by manually importing one of:
17
+
18
+ - `import 'conductor-node/shims/node'`
19
+ - `import 'conductor-node/shims/web'`
20
+
21
+ All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
22
+
23
+ ### How it works - Runtime
24
+
25
+ Runtime shims get installed by calling `setShims` exported by `conductor-node/_shims/registry`.
26
+
27
+ Manually importing `conductor-node/shims/node` or `conductor-node/shims/web`, calls `setShims` with the respective runtime shims.
28
+
29
+ All client code imports shims from `conductor-node/_shims/index`, which:
30
+
31
+ - checks if shims have been set manually
32
+ - if not, calls `setShims` with the shims from `conductor-node/_shims/auto/runtime`
33
+ - re-exports the installed shims from `conductor-node/_shims/registry`.
34
+
35
+ `conductor-node/_shims/auto/runtime` exports web runtime shims.
36
+ If the `node` export condition is set, the export map replaces it with `conductor-node/_shims/auto/runtime-node`.
37
+
38
+ ### How it works - Type time
39
+
40
+ All client code imports shim types from `conductor-node/_shims/index`, which selects the manual types from `conductor-node/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `conductor-node/_shims/auto/types`.
41
+
42
+ `conductor-node/_shims/manual-types` exports an empty namespace.
43
+ Manually importing `conductor-node/shims/node` or `conductor-node/shims/web` merges declarations into this empty namespace, so they get picked up by `conductor-node/_shims/index`.
44
+
45
+ `conductor-node/_shims/auto/types` exports web type definitions.
46
+ If the `node` export condition is set, the export map replaces it with `conductor-node/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../bun-runtime.js";
5
+ //# sourceMappingURL=runtime-bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../bun-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from "../bun-runtime.mjs";
2
+ //# sourceMappingURL=runtime-bun.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-runtime.js";
5
+ //# sourceMappingURL=runtime-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
@@ -0,0 +1,2 @@
1
+ export * from "../node-runtime.mjs";
2
+ //# sourceMappingURL=runtime-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../web-runtime.js";
5
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}