@paid-ai/paid-node 0.0.5

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 (383) hide show
  1. package/README.md +166 -0
  2. package/dist/cjs/Client.d.ts +44 -0
  3. package/dist/cjs/Client.js +79 -0
  4. package/dist/cjs/api/index.d.ts +2 -0
  5. package/dist/cjs/api/index.js +18 -0
  6. package/dist/cjs/api/resources/agents/client/Client.d.ts +107 -0
  7. package/dist/cjs/api/resources/agents/client/Client.js +464 -0
  8. package/dist/cjs/api/resources/agents/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/agents/client/index.js +17 -0
  10. package/dist/cjs/api/resources/agents/client/requests/AgentCreate.d.ts +16 -0
  11. package/dist/cjs/api/resources/agents/client/requests/AgentCreate.js +5 -0
  12. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/agents/client/requests/index.js +2 -0
  14. package/dist/cjs/api/resources/agents/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/agents/index.js +17 -0
  16. package/dist/cjs/api/resources/contacts/client/Client.d.ts +93 -0
  17. package/dist/cjs/api/resources/contacts/client/Client.js +366 -0
  18. package/dist/cjs/api/resources/contacts/client/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/contacts/client/index.js +17 -0
  20. package/dist/cjs/api/resources/contacts/client/requests/ContactCreate.d.ts +32 -0
  21. package/dist/cjs/api/resources/contacts/client/requests/ContactCreate.js +5 -0
  22. package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/contacts/client/requests/index.js +2 -0
  24. package/dist/cjs/api/resources/contacts/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/contacts/index.js +17 -0
  26. package/dist/cjs/api/resources/customers/client/Client.d.ts +106 -0
  27. package/dist/cjs/api/resources/customers/client/Client.js +463 -0
  28. package/dist/cjs/api/resources/customers/client/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/customers/client/index.js +17 -0
  30. package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.d.ts +21 -0
  31. package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.js +5 -0
  32. package/dist/cjs/api/resources/customers/client/requests/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/customers/client/requests/index.js +2 -0
  34. package/dist/cjs/api/resources/customers/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/customers/index.js +17 -0
  36. package/dist/cjs/api/resources/index.d.ts +10 -0
  37. package/dist/cjs/api/resources/index.js +49 -0
  38. package/dist/cjs/api/resources/orders/client/Client.d.ts +84 -0
  39. package/dist/cjs/api/resources/orders/client/Client.js +320 -0
  40. package/dist/cjs/api/resources/orders/client/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/orders/client/index.js +17 -0
  42. package/dist/cjs/api/resources/orders/client/requests/OrderCreate.d.ts +25 -0
  43. package/dist/cjs/api/resources/orders/client/requests/OrderCreate.js +5 -0
  44. package/dist/cjs/api/resources/orders/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/orders/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/orders/index.d.ts +2 -0
  47. package/dist/cjs/api/resources/orders/index.js +18 -0
  48. package/dist/cjs/api/resources/orders/resources/index.d.ts +2 -0
  49. package/dist/cjs/api/resources/orders/resources/index.js +41 -0
  50. package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +41 -0
  51. package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +119 -0
  52. package/dist/cjs/api/resources/orders/resources/lines/client/index.d.ts +1 -0
  53. package/dist/cjs/api/resources/orders/resources/lines/client/index.js +17 -0
  54. package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.ts +11 -0
  55. package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.js +5 -0
  56. package/dist/cjs/api/resources/orders/resources/lines/client/requests/index.d.ts +1 -0
  57. package/dist/cjs/api/resources/orders/resources/lines/client/requests/index.js +2 -0
  58. package/dist/cjs/api/resources/orders/resources/lines/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/orders/resources/lines/index.js +17 -0
  60. package/dist/cjs/api/resources/usage/client/Client.d.ts +40 -0
  61. package/dist/cjs/api/resources/usage/client/Client.js +118 -0
  62. package/dist/cjs/api/resources/usage/client/index.d.ts +1 -0
  63. package/dist/cjs/api/resources/usage/client/index.js +17 -0
  64. package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkRequest.d.ts +11 -0
  65. package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkRequest.js +5 -0
  66. package/dist/cjs/api/resources/usage/client/requests/index.d.ts +1 -0
  67. package/dist/cjs/api/resources/usage/client/requests/index.js +2 -0
  68. package/dist/cjs/api/resources/usage/index.d.ts +1 -0
  69. package/dist/cjs/api/resources/usage/index.js +17 -0
  70. package/dist/cjs/api/types/Address.d.ts +11 -0
  71. package/dist/cjs/api/types/Address.js +5 -0
  72. package/dist/cjs/api/types/Agent.d.ts +14 -0
  73. package/dist/cjs/api/types/Agent.js +5 -0
  74. package/dist/cjs/api/types/AgentAttribute.d.ts +9 -0
  75. package/dist/cjs/api/types/AgentAttribute.js +5 -0
  76. package/dist/cjs/api/types/AgentPricePoint.d.ts +10 -0
  77. package/dist/cjs/api/types/AgentPricePoint.js +5 -0
  78. package/dist/cjs/api/types/AgentPricePointTiers.d.ts +8 -0
  79. package/dist/cjs/api/types/AgentPricePointTiers.js +5 -0
  80. package/dist/cjs/api/types/AgentUpdate.d.ts +12 -0
  81. package/dist/cjs/api/types/AgentUpdate.js +5 -0
  82. package/dist/cjs/api/types/ApiError.d.ts +12 -0
  83. package/dist/cjs/api/types/ApiError.js +5 -0
  84. package/dist/cjs/api/types/BillingFrequency.d.ts +9 -0
  85. package/dist/cjs/api/types/BillingFrequency.js +11 -0
  86. package/dist/cjs/api/types/ChargeType.d.ts +10 -0
  87. package/dist/cjs/api/types/ChargeType.js +12 -0
  88. package/dist/cjs/api/types/Contact.d.ts +21 -0
  89. package/dist/cjs/api/types/Contact.js +5 -0
  90. package/dist/cjs/api/types/CreationSource.d.ts +10 -0
  91. package/dist/cjs/api/types/CreationSource.js +12 -0
  92. package/dist/cjs/api/types/CreationState.d.ts +8 -0
  93. package/dist/cjs/api/types/CreationState.js +10 -0
  94. package/dist/cjs/api/types/Customer.d.ts +18 -0
  95. package/dist/cjs/api/types/Customer.js +5 -0
  96. package/dist/cjs/api/types/CustomerUpdate.d.ts +15 -0
  97. package/dist/cjs/api/types/CustomerUpdate.js +5 -0
  98. package/dist/cjs/api/types/Error_.d.ts +10 -0
  99. package/dist/cjs/api/types/Error_.js +5 -0
  100. package/dist/cjs/api/types/Order.d.ts +22 -0
  101. package/dist/cjs/api/types/Order.js +5 -0
  102. package/dist/cjs/api/types/OrderLine.d.ts +20 -0
  103. package/dist/cjs/api/types/OrderLine.js +5 -0
  104. package/dist/cjs/api/types/OrderLineAttribute.d.ts +10 -0
  105. package/dist/cjs/api/types/OrderLineAttribute.js +5 -0
  106. package/dist/cjs/api/types/OrderLineAttributePricing.d.ts +11 -0
  107. package/dist/cjs/api/types/OrderLineAttributePricing.js +5 -0
  108. package/dist/cjs/api/types/OrderLineCreate.d.ts +9 -0
  109. package/dist/cjs/api/types/OrderLineCreate.js +5 -0
  110. package/dist/cjs/api/types/PricePoint.d.ts +10 -0
  111. package/dist/cjs/api/types/PricePoint.js +5 -0
  112. package/dist/cjs/api/types/Pricing.d.ts +12 -0
  113. package/dist/cjs/api/types/Pricing.js +5 -0
  114. package/dist/cjs/api/types/PricingModelType.d.ts +9 -0
  115. package/dist/cjs/api/types/PricingModelType.js +11 -0
  116. package/dist/cjs/api/types/Salutation.d.ts +12 -0
  117. package/dist/cjs/api/types/Salutation.js +14 -0
  118. package/dist/cjs/api/types/Signal.d.ts +9 -0
  119. package/dist/cjs/api/types/Signal.js +5 -0
  120. package/dist/cjs/api/types/TaxExemptStatus.d.ts +9 -0
  121. package/dist/cjs/api/types/TaxExemptStatus.js +11 -0
  122. package/dist/cjs/api/types/Tier.d.ts +8 -0
  123. package/dist/cjs/api/types/Tier.js +5 -0
  124. package/dist/cjs/api/types/index.d.ts +27 -0
  125. package/dist/cjs/api/types/index.js +43 -0
  126. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  127. package/dist/cjs/core/auth/BasicAuth.js +26 -0
  128. package/dist/cjs/core/auth/BearerToken.d.ts +5 -0
  129. package/dist/cjs/core/auth/BearerToken.js +15 -0
  130. package/dist/cjs/core/auth/index.d.ts +2 -0
  131. package/dist/cjs/core/auth/index.js +7 -0
  132. package/dist/cjs/core/fetcher/APIResponse.d.ts +20 -0
  133. package/dist/cjs/core/fetcher/APIResponse.js +2 -0
  134. package/dist/cjs/core/fetcher/Fetcher.d.ts +40 -0
  135. package/dist/cjs/core/fetcher/Fetcher.js +120 -0
  136. package/dist/cjs/core/fetcher/Headers.d.ts +2 -0
  137. package/dist/cjs/core/fetcher/Headers.js +84 -0
  138. package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +58 -0
  139. package/dist/cjs/core/fetcher/HttpResponsePromise.js +103 -0
  140. package/dist/cjs/core/fetcher/RawResponse.d.ts +29 -0
  141. package/dist/cjs/core/fetcher/RawResponse.js +44 -0
  142. package/dist/cjs/core/fetcher/Supplier.d.ts +4 -0
  143. package/dist/cjs/core/fetcher/Supplier.js +22 -0
  144. package/dist/cjs/core/fetcher/createRequestUrl.d.ts +1 -0
  145. package/dist/cjs/core/fetcher/createRequestUrl.js +12 -0
  146. package/dist/cjs/core/fetcher/getFetchFn.d.ts +4 -0
  147. package/dist/cjs/core/fetcher/getFetchFn.js +68 -0
  148. package/dist/cjs/core/fetcher/getHeader.d.ts +1 -0
  149. package/dist/cjs/core/fetcher/getHeader.js +11 -0
  150. package/dist/cjs/core/fetcher/getRequestBody.d.ts +7 -0
  151. package/dist/cjs/core/fetcher/getRequestBody.js +23 -0
  152. package/dist/cjs/core/fetcher/getResponseBody.d.ts +1 -0
  153. package/dist/cjs/core/fetcher/getResponseBody.js +54 -0
  154. package/dist/cjs/core/fetcher/index.d.ts +8 -0
  155. package/dist/cjs/core/fetcher/index.js +15 -0
  156. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -0
  157. package/dist/cjs/core/fetcher/makeRequest.js +42 -0
  158. package/dist/cjs/core/fetcher/requestWithRetries.d.ts +1 -0
  159. package/dist/cjs/core/fetcher/requestWithRetries.js +40 -0
  160. package/dist/cjs/core/fetcher/signals.d.ts +11 -0
  161. package/dist/cjs/core/fetcher/signals.js +36 -0
  162. package/dist/cjs/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  163. package/dist/cjs/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  164. package/dist/cjs/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
  165. package/dist/cjs/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
  166. package/dist/cjs/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  167. package/dist/cjs/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  168. package/dist/cjs/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  169. package/dist/cjs/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
  170. package/dist/cjs/core/headers.d.ts +3 -0
  171. package/dist/cjs/core/headers.js +29 -0
  172. package/dist/cjs/core/index.d.ts +3 -0
  173. package/dist/cjs/core/index.js +19 -0
  174. package/dist/cjs/core/json.d.ts +15 -0
  175. package/dist/cjs/core/json.js +24 -0
  176. package/dist/cjs/core/runtime/index.d.ts +1 -0
  177. package/dist/cjs/core/runtime/index.js +5 -0
  178. package/dist/cjs/core/runtime/runtime.d.ts +9 -0
  179. package/dist/cjs/core/runtime/runtime.js +103 -0
  180. package/dist/cjs/environments.d.ts +7 -0
  181. package/dist/cjs/environments.js +9 -0
  182. package/dist/cjs/errors/PaidApiError.d.ts +15 -0
  183. package/dist/cjs/errors/PaidApiError.js +30 -0
  184. package/dist/cjs/errors/PaidApiTimeoutError.d.ts +6 -0
  185. package/dist/cjs/errors/PaidApiTimeoutError.js +13 -0
  186. package/dist/cjs/errors/index.d.ts +2 -0
  187. package/dist/cjs/errors/index.js +7 -0
  188. package/dist/cjs/index.d.ts +4 -0
  189. package/dist/cjs/index.js +44 -0
  190. package/dist/cjs/version.d.ts +1 -0
  191. package/dist/cjs/version.js +4 -0
  192. package/dist/esm/Client.d.mts +44 -0
  193. package/dist/esm/Client.mjs +42 -0
  194. package/dist/esm/api/index.d.mts +2 -0
  195. package/dist/esm/api/index.mjs +2 -0
  196. package/dist/esm/api/resources/agents/client/Client.d.mts +107 -0
  197. package/dist/esm/api/resources/agents/client/Client.mjs +424 -0
  198. package/dist/esm/api/resources/agents/client/index.d.mts +1 -0
  199. package/dist/esm/api/resources/agents/client/index.mjs +1 -0
  200. package/dist/esm/api/resources/agents/client/requests/AgentCreate.d.mts +16 -0
  201. package/dist/esm/api/resources/agents/client/requests/AgentCreate.mjs +4 -0
  202. package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -0
  203. package/dist/esm/api/resources/agents/client/requests/index.mjs +1 -0
  204. package/dist/esm/api/resources/agents/index.d.mts +1 -0
  205. package/dist/esm/api/resources/agents/index.mjs +1 -0
  206. package/dist/esm/api/resources/contacts/client/Client.d.mts +93 -0
  207. package/dist/esm/api/resources/contacts/client/Client.mjs +326 -0
  208. package/dist/esm/api/resources/contacts/client/index.d.mts +1 -0
  209. package/dist/esm/api/resources/contacts/client/index.mjs +1 -0
  210. package/dist/esm/api/resources/contacts/client/requests/ContactCreate.d.mts +32 -0
  211. package/dist/esm/api/resources/contacts/client/requests/ContactCreate.mjs +4 -0
  212. package/dist/esm/api/resources/contacts/client/requests/index.d.mts +1 -0
  213. package/dist/esm/api/resources/contacts/client/requests/index.mjs +1 -0
  214. package/dist/esm/api/resources/contacts/index.d.mts +1 -0
  215. package/dist/esm/api/resources/contacts/index.mjs +1 -0
  216. package/dist/esm/api/resources/customers/client/Client.d.mts +106 -0
  217. package/dist/esm/api/resources/customers/client/Client.mjs +423 -0
  218. package/dist/esm/api/resources/customers/client/index.d.mts +1 -0
  219. package/dist/esm/api/resources/customers/client/index.mjs +1 -0
  220. package/dist/esm/api/resources/customers/client/requests/CustomerCreate.d.mts +21 -0
  221. package/dist/esm/api/resources/customers/client/requests/CustomerCreate.mjs +4 -0
  222. package/dist/esm/api/resources/customers/client/requests/index.d.mts +1 -0
  223. package/dist/esm/api/resources/customers/client/requests/index.mjs +1 -0
  224. package/dist/esm/api/resources/customers/index.d.mts +1 -0
  225. package/dist/esm/api/resources/customers/index.mjs +1 -0
  226. package/dist/esm/api/resources/index.d.mts +10 -0
  227. package/dist/esm/api/resources/index.mjs +10 -0
  228. package/dist/esm/api/resources/orders/client/Client.d.mts +84 -0
  229. package/dist/esm/api/resources/orders/client/Client.mjs +280 -0
  230. package/dist/esm/api/resources/orders/client/index.d.mts +1 -0
  231. package/dist/esm/api/resources/orders/client/index.mjs +1 -0
  232. package/dist/esm/api/resources/orders/client/requests/OrderCreate.d.mts +25 -0
  233. package/dist/esm/api/resources/orders/client/requests/OrderCreate.mjs +4 -0
  234. package/dist/esm/api/resources/orders/client/requests/index.d.mts +1 -0
  235. package/dist/esm/api/resources/orders/client/requests/index.mjs +1 -0
  236. package/dist/esm/api/resources/orders/index.d.mts +2 -0
  237. package/dist/esm/api/resources/orders/index.mjs +2 -0
  238. package/dist/esm/api/resources/orders/resources/index.d.mts +2 -0
  239. package/dist/esm/api/resources/orders/resources/index.mjs +2 -0
  240. package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +41 -0
  241. package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +79 -0
  242. package/dist/esm/api/resources/orders/resources/lines/client/index.d.mts +1 -0
  243. package/dist/esm/api/resources/orders/resources/lines/client/index.mjs +1 -0
  244. package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.mts +11 -0
  245. package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.mjs +4 -0
  246. package/dist/esm/api/resources/orders/resources/lines/client/requests/index.d.mts +1 -0
  247. package/dist/esm/api/resources/orders/resources/lines/client/requests/index.mjs +1 -0
  248. package/dist/esm/api/resources/orders/resources/lines/index.d.mts +1 -0
  249. package/dist/esm/api/resources/orders/resources/lines/index.mjs +1 -0
  250. package/dist/esm/api/resources/usage/client/Client.d.mts +40 -0
  251. package/dist/esm/api/resources/usage/client/Client.mjs +78 -0
  252. package/dist/esm/api/resources/usage/client/index.d.mts +1 -0
  253. package/dist/esm/api/resources/usage/client/index.mjs +1 -0
  254. package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkRequest.d.mts +11 -0
  255. package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkRequest.mjs +4 -0
  256. package/dist/esm/api/resources/usage/client/requests/index.d.mts +1 -0
  257. package/dist/esm/api/resources/usage/client/requests/index.mjs +1 -0
  258. package/dist/esm/api/resources/usage/index.d.mts +1 -0
  259. package/dist/esm/api/resources/usage/index.mjs +1 -0
  260. package/dist/esm/api/types/Address.d.mts +11 -0
  261. package/dist/esm/api/types/Address.mjs +4 -0
  262. package/dist/esm/api/types/Agent.d.mts +14 -0
  263. package/dist/esm/api/types/Agent.mjs +4 -0
  264. package/dist/esm/api/types/AgentAttribute.d.mts +9 -0
  265. package/dist/esm/api/types/AgentAttribute.mjs +4 -0
  266. package/dist/esm/api/types/AgentPricePoint.d.mts +10 -0
  267. package/dist/esm/api/types/AgentPricePoint.mjs +4 -0
  268. package/dist/esm/api/types/AgentPricePointTiers.d.mts +8 -0
  269. package/dist/esm/api/types/AgentPricePointTiers.mjs +4 -0
  270. package/dist/esm/api/types/AgentUpdate.d.mts +12 -0
  271. package/dist/esm/api/types/AgentUpdate.mjs +4 -0
  272. package/dist/esm/api/types/ApiError.d.mts +12 -0
  273. package/dist/esm/api/types/ApiError.mjs +4 -0
  274. package/dist/esm/api/types/BillingFrequency.d.mts +9 -0
  275. package/dist/esm/api/types/BillingFrequency.mjs +8 -0
  276. package/dist/esm/api/types/ChargeType.d.mts +10 -0
  277. package/dist/esm/api/types/ChargeType.mjs +9 -0
  278. package/dist/esm/api/types/Contact.d.mts +21 -0
  279. package/dist/esm/api/types/Contact.mjs +4 -0
  280. package/dist/esm/api/types/CreationSource.d.mts +10 -0
  281. package/dist/esm/api/types/CreationSource.mjs +9 -0
  282. package/dist/esm/api/types/CreationState.d.mts +8 -0
  283. package/dist/esm/api/types/CreationState.mjs +7 -0
  284. package/dist/esm/api/types/Customer.d.mts +18 -0
  285. package/dist/esm/api/types/Customer.mjs +4 -0
  286. package/dist/esm/api/types/CustomerUpdate.d.mts +15 -0
  287. package/dist/esm/api/types/CustomerUpdate.mjs +4 -0
  288. package/dist/esm/api/types/Error_.d.mts +10 -0
  289. package/dist/esm/api/types/Error_.mjs +4 -0
  290. package/dist/esm/api/types/Order.d.mts +22 -0
  291. package/dist/esm/api/types/Order.mjs +4 -0
  292. package/dist/esm/api/types/OrderLine.d.mts +20 -0
  293. package/dist/esm/api/types/OrderLine.mjs +4 -0
  294. package/dist/esm/api/types/OrderLineAttribute.d.mts +10 -0
  295. package/dist/esm/api/types/OrderLineAttribute.mjs +4 -0
  296. package/dist/esm/api/types/OrderLineAttributePricing.d.mts +11 -0
  297. package/dist/esm/api/types/OrderLineAttributePricing.mjs +4 -0
  298. package/dist/esm/api/types/OrderLineCreate.d.mts +9 -0
  299. package/dist/esm/api/types/OrderLineCreate.mjs +4 -0
  300. package/dist/esm/api/types/PricePoint.d.mts +10 -0
  301. package/dist/esm/api/types/PricePoint.mjs +4 -0
  302. package/dist/esm/api/types/Pricing.d.mts +12 -0
  303. package/dist/esm/api/types/Pricing.mjs +4 -0
  304. package/dist/esm/api/types/PricingModelType.d.mts +9 -0
  305. package/dist/esm/api/types/PricingModelType.mjs +8 -0
  306. package/dist/esm/api/types/Salutation.d.mts +12 -0
  307. package/dist/esm/api/types/Salutation.mjs +11 -0
  308. package/dist/esm/api/types/Signal.d.mts +9 -0
  309. package/dist/esm/api/types/Signal.mjs +4 -0
  310. package/dist/esm/api/types/TaxExemptStatus.d.mts +9 -0
  311. package/dist/esm/api/types/TaxExemptStatus.mjs +8 -0
  312. package/dist/esm/api/types/Tier.d.mts +8 -0
  313. package/dist/esm/api/types/Tier.mjs +4 -0
  314. package/dist/esm/api/types/index.d.mts +27 -0
  315. package/dist/esm/api/types/index.mjs +27 -0
  316. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  317. package/dist/esm/core/auth/BasicAuth.mjs +23 -0
  318. package/dist/esm/core/auth/BearerToken.d.mts +5 -0
  319. package/dist/esm/core/auth/BearerToken.mjs +12 -0
  320. package/dist/esm/core/auth/index.d.mts +2 -0
  321. package/dist/esm/core/auth/index.mjs +2 -0
  322. package/dist/esm/core/fetcher/APIResponse.d.mts +20 -0
  323. package/dist/esm/core/fetcher/APIResponse.mjs +1 -0
  324. package/dist/esm/core/fetcher/Fetcher.d.mts +40 -0
  325. package/dist/esm/core/fetcher/Fetcher.mjs +116 -0
  326. package/dist/esm/core/fetcher/Headers.d.mts +2 -0
  327. package/dist/esm/core/fetcher/Headers.mjs +82 -0
  328. package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +58 -0
  329. package/dist/esm/core/fetcher/HttpResponsePromise.mjs +99 -0
  330. package/dist/esm/core/fetcher/RawResponse.d.mts +29 -0
  331. package/dist/esm/core/fetcher/RawResponse.mjs +40 -0
  332. package/dist/esm/core/fetcher/Supplier.d.mts +4 -0
  333. package/dist/esm/core/fetcher/Supplier.mjs +19 -0
  334. package/dist/esm/core/fetcher/createRequestUrl.d.mts +1 -0
  335. package/dist/esm/core/fetcher/createRequestUrl.mjs +6 -0
  336. package/dist/esm/core/fetcher/getFetchFn.d.mts +4 -0
  337. package/dist/esm/core/fetcher/getFetchFn.mjs +32 -0
  338. package/dist/esm/core/fetcher/getHeader.d.mts +1 -0
  339. package/dist/esm/core/fetcher/getHeader.mjs +8 -0
  340. package/dist/esm/core/fetcher/getRequestBody.d.mts +7 -0
  341. package/dist/esm/core/fetcher/getRequestBody.mjs +20 -0
  342. package/dist/esm/core/fetcher/getResponseBody.d.mts +1 -0
  343. package/dist/esm/core/fetcher/getResponseBody.mjs +51 -0
  344. package/dist/esm/core/fetcher/index.d.mts +8 -0
  345. package/dist/esm/core/fetcher/index.mjs +5 -0
  346. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -0
  347. package/dist/esm/core/fetcher/makeRequest.mjs +38 -0
  348. package/dist/esm/core/fetcher/requestWithRetries.d.mts +1 -0
  349. package/dist/esm/core/fetcher/requestWithRetries.mjs +37 -0
  350. package/dist/esm/core/fetcher/signals.d.mts +11 -0
  351. package/dist/esm/core/fetcher/signals.mjs +32 -0
  352. package/dist/esm/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.mts +30 -0
  353. package/dist/esm/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.mjs +243 -0
  354. package/dist/esm/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.mts +21 -0
  355. package/dist/esm/core/fetcher/stream-wrappers/NodePre18StreamWrapper.mjs +122 -0
  356. package/dist/esm/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.mts +31 -0
  357. package/dist/esm/core/fetcher/stream-wrappers/UndiciStreamWrapper.mjs +225 -0
  358. package/dist/esm/core/fetcher/stream-wrappers/chooseStreamWrapper.d.mts +18 -0
  359. package/dist/esm/core/fetcher/stream-wrappers/chooseStreamWrapper.mjs +23 -0
  360. package/dist/esm/core/headers.d.mts +3 -0
  361. package/dist/esm/core/headers.mjs +25 -0
  362. package/dist/esm/core/index.d.mts +3 -0
  363. package/dist/esm/core/index.mjs +3 -0
  364. package/dist/esm/core/json.d.mts +15 -0
  365. package/dist/esm/core/json.mjs +19 -0
  366. package/dist/esm/core/runtime/index.d.mts +1 -0
  367. package/dist/esm/core/runtime/index.mjs +1 -0
  368. package/dist/esm/core/runtime/runtime.d.mts +9 -0
  369. package/dist/esm/core/runtime/runtime.mjs +100 -0
  370. package/dist/esm/environments.d.mts +7 -0
  371. package/dist/esm/environments.mjs +6 -0
  372. package/dist/esm/errors/PaidApiError.d.mts +15 -0
  373. package/dist/esm/errors/PaidApiError.mjs +26 -0
  374. package/dist/esm/errors/PaidApiTimeoutError.d.mts +6 -0
  375. package/dist/esm/errors/PaidApiTimeoutError.mjs +9 -0
  376. package/dist/esm/errors/index.d.mts +2 -0
  377. package/dist/esm/errors/index.mjs +2 -0
  378. package/dist/esm/index.d.mts +4 -0
  379. package/dist/esm/index.mjs +4 -0
  380. package/dist/esm/version.d.mts +1 -0
  381. package/dist/esm/version.mjs +1 -0
  382. package/package.json +70 -0
  383. package/reference.md +1433 -0
@@ -0,0 +1,366 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Contacts = void 0;
52
+ const environments = __importStar(require("../../../../environments.js"));
53
+ const core = __importStar(require("../../../../core/index.js"));
54
+ const headers_js_1 = require("../../../../core/headers.js");
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const errors = __importStar(require("../../../../errors/index.js"));
57
+ class Contacts {
58
+ constructor(_options) {
59
+ this._options = _options;
60
+ }
61
+ /**
62
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @example
65
+ * await client.contacts.list()
66
+ */
67
+ list(requestOptions) {
68
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
69
+ }
70
+ __list(requestOptions) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ var _a, _b, _c;
73
+ const _response = yield core.fetcher({
74
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, "contacts"),
75
+ method: "GET",
76
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
77
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
78
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
79
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
80
+ });
81
+ if (_response.ok) {
82
+ return { data: _response.body, rawResponse: _response.rawResponse };
83
+ }
84
+ if (_response.error.reason === "status-code") {
85
+ throw new errors.PaidApiError({
86
+ statusCode: _response.error.statusCode,
87
+ body: _response.error.body,
88
+ rawResponse: _response.rawResponse,
89
+ });
90
+ }
91
+ switch (_response.error.reason) {
92
+ case "non-json":
93
+ throw new errors.PaidApiError({
94
+ statusCode: _response.error.statusCode,
95
+ body: _response.error.rawBody,
96
+ rawResponse: _response.rawResponse,
97
+ });
98
+ case "timeout":
99
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /contacts.");
100
+ case "unknown":
101
+ throw new errors.PaidApiError({
102
+ message: _response.error.errorMessage,
103
+ rawResponse: _response.rawResponse,
104
+ });
105
+ }
106
+ });
107
+ }
108
+ /**
109
+ * @param {PaidApi.ContactCreate} request
110
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
111
+ *
112
+ * @example
113
+ * await client.contacts.create({
114
+ * salutation: "Mr.",
115
+ * firstName: "firstName",
116
+ * lastName: "lastName",
117
+ * email: "email",
118
+ * billingStreet: "billingStreet",
119
+ * billingCity: "billingCity",
120
+ * billingCountry: "billingCountry",
121
+ * billingPostalCode: "billingPostalCode"
122
+ * })
123
+ */
124
+ create(request, requestOptions) {
125
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
126
+ }
127
+ __create(request, requestOptions) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ var _a, _b, _c;
130
+ const _response = yield core.fetcher({
131
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, "contacts"),
132
+ method: "POST",
133
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
134
+ contentType: "application/json",
135
+ requestType: "json",
136
+ body: request,
137
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
138
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
139
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
140
+ });
141
+ if (_response.ok) {
142
+ return { data: _response.body, rawResponse: _response.rawResponse };
143
+ }
144
+ if (_response.error.reason === "status-code") {
145
+ throw new errors.PaidApiError({
146
+ statusCode: _response.error.statusCode,
147
+ body: _response.error.body,
148
+ rawResponse: _response.rawResponse,
149
+ });
150
+ }
151
+ switch (_response.error.reason) {
152
+ case "non-json":
153
+ throw new errors.PaidApiError({
154
+ statusCode: _response.error.statusCode,
155
+ body: _response.error.rawBody,
156
+ rawResponse: _response.rawResponse,
157
+ });
158
+ case "timeout":
159
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling POST /contacts.");
160
+ case "unknown":
161
+ throw new errors.PaidApiError({
162
+ message: _response.error.errorMessage,
163
+ rawResponse: _response.rawResponse,
164
+ });
165
+ }
166
+ });
167
+ }
168
+ /**
169
+ * @param {string} contactId
170
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
171
+ *
172
+ * @example
173
+ * await client.contacts.get("contactId")
174
+ */
175
+ get(contactId, requestOptions) {
176
+ return core.HttpResponsePromise.fromPromise(this.__get(contactId, requestOptions));
177
+ }
178
+ __get(contactId, requestOptions) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ var _a, _b, _c;
181
+ const _response = yield core.fetcher({
182
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `contacts/${encodeURIComponent(contactId)}`),
183
+ method: "GET",
184
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
185
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
186
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
187
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
188
+ });
189
+ if (_response.ok) {
190
+ return { data: _response.body, rawResponse: _response.rawResponse };
191
+ }
192
+ if (_response.error.reason === "status-code") {
193
+ throw new errors.PaidApiError({
194
+ statusCode: _response.error.statusCode,
195
+ body: _response.error.body,
196
+ rawResponse: _response.rawResponse,
197
+ });
198
+ }
199
+ switch (_response.error.reason) {
200
+ case "non-json":
201
+ throw new errors.PaidApiError({
202
+ statusCode: _response.error.statusCode,
203
+ body: _response.error.rawBody,
204
+ rawResponse: _response.rawResponse,
205
+ });
206
+ case "timeout":
207
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /contacts/{contactId}.");
208
+ case "unknown":
209
+ throw new errors.PaidApiError({
210
+ message: _response.error.errorMessage,
211
+ rawResponse: _response.rawResponse,
212
+ });
213
+ }
214
+ });
215
+ }
216
+ /**
217
+ * @param {string} contactId
218
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
219
+ *
220
+ * @example
221
+ * await client.contacts.delete("contactId")
222
+ */
223
+ delete(contactId, requestOptions) {
224
+ return core.HttpResponsePromise.fromPromise(this.__delete(contactId, requestOptions));
225
+ }
226
+ __delete(contactId, requestOptions) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ var _a, _b, _c;
229
+ const _response = yield core.fetcher({
230
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `contacts/${encodeURIComponent(contactId)}`),
231
+ method: "DELETE",
232
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
233
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
234
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
235
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
236
+ });
237
+ if (_response.ok) {
238
+ return { data: undefined, rawResponse: _response.rawResponse };
239
+ }
240
+ if (_response.error.reason === "status-code") {
241
+ throw new errors.PaidApiError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ switch (_response.error.reason) {
248
+ case "non-json":
249
+ throw new errors.PaidApiError({
250
+ statusCode: _response.error.statusCode,
251
+ body: _response.error.rawBody,
252
+ rawResponse: _response.rawResponse,
253
+ });
254
+ case "timeout":
255
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling DELETE /contacts/{contactId}.");
256
+ case "unknown":
257
+ throw new errors.PaidApiError({
258
+ message: _response.error.errorMessage,
259
+ rawResponse: _response.rawResponse,
260
+ });
261
+ }
262
+ });
263
+ }
264
+ /**
265
+ * @param {string} externalId
266
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
267
+ *
268
+ * @example
269
+ * await client.contacts.getByExternalId("externalId")
270
+ */
271
+ getByExternalId(externalId, requestOptions) {
272
+ return core.HttpResponsePromise.fromPromise(this.__getByExternalId(externalId, requestOptions));
273
+ }
274
+ __getByExternalId(externalId, requestOptions) {
275
+ return __awaiter(this, void 0, void 0, function* () {
276
+ var _a, _b, _c;
277
+ const _response = yield core.fetcher({
278
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `contacts/external/${encodeURIComponent(externalId)}`),
279
+ method: "GET",
280
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
281
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
282
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
283
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
284
+ });
285
+ if (_response.ok) {
286
+ return { data: _response.body, rawResponse: _response.rawResponse };
287
+ }
288
+ if (_response.error.reason === "status-code") {
289
+ throw new errors.PaidApiError({
290
+ statusCode: _response.error.statusCode,
291
+ body: _response.error.body,
292
+ rawResponse: _response.rawResponse,
293
+ });
294
+ }
295
+ switch (_response.error.reason) {
296
+ case "non-json":
297
+ throw new errors.PaidApiError({
298
+ statusCode: _response.error.statusCode,
299
+ body: _response.error.rawBody,
300
+ rawResponse: _response.rawResponse,
301
+ });
302
+ case "timeout":
303
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /contacts/external/{externalId}.");
304
+ case "unknown":
305
+ throw new errors.PaidApiError({
306
+ message: _response.error.errorMessage,
307
+ rawResponse: _response.rawResponse,
308
+ });
309
+ }
310
+ });
311
+ }
312
+ /**
313
+ * @param {string} externalId
314
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
315
+ *
316
+ * @example
317
+ * await client.contacts.deleteByExternalId("externalId")
318
+ */
319
+ deleteByExternalId(externalId, requestOptions) {
320
+ return core.HttpResponsePromise.fromPromise(this.__deleteByExternalId(externalId, requestOptions));
321
+ }
322
+ __deleteByExternalId(externalId, requestOptions) {
323
+ return __awaiter(this, void 0, void 0, function* () {
324
+ var _a, _b, _c;
325
+ const _response = yield core.fetcher({
326
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `contacts/external/${encodeURIComponent(externalId)}`),
327
+ method: "DELETE",
328
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
329
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
330
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
331
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
332
+ });
333
+ if (_response.ok) {
334
+ return { data: undefined, rawResponse: _response.rawResponse };
335
+ }
336
+ if (_response.error.reason === "status-code") {
337
+ throw new errors.PaidApiError({
338
+ statusCode: _response.error.statusCode,
339
+ body: _response.error.body,
340
+ rawResponse: _response.rawResponse,
341
+ });
342
+ }
343
+ switch (_response.error.reason) {
344
+ case "non-json":
345
+ throw new errors.PaidApiError({
346
+ statusCode: _response.error.statusCode,
347
+ body: _response.error.rawBody,
348
+ rawResponse: _response.rawResponse,
349
+ });
350
+ case "timeout":
351
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling DELETE /contacts/external/{externalId}.");
352
+ case "unknown":
353
+ throw new errors.PaidApiError({
354
+ message: _response.error.errorMessage,
355
+ rawResponse: _response.rawResponse,
356
+ });
357
+ }
358
+ });
359
+ }
360
+ _getAuthorizationHeader() {
361
+ return __awaiter(this, void 0, void 0, function* () {
362
+ return `Bearer ${yield core.Supplier.get(this._options.token)}`;
363
+ });
364
+ }
365
+ }
366
+ exports.Contacts = Contacts;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
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
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as PaidApi from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * salutation: "Mr.",
9
+ * firstName: "firstName",
10
+ * lastName: "lastName",
11
+ * email: "email",
12
+ * billingStreet: "billingStreet",
13
+ * billingCity: "billingCity",
14
+ * billingCountry: "billingCountry",
15
+ * billingPostalCode: "billingPostalCode"
16
+ * }
17
+ */
18
+ export interface ContactCreate {
19
+ externalId?: string;
20
+ customerId?: string;
21
+ customerExternalId?: string;
22
+ salutation: PaidApi.Salutation;
23
+ firstName: string;
24
+ lastName: string;
25
+ email: string;
26
+ phone?: string;
27
+ billingStreet: string;
28
+ billingCity: string;
29
+ billingStateProvince?: string;
30
+ billingCountry: string;
31
+ billingPostalCode: string;
32
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type ContactCreate } from "./ContactCreate.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
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
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,106 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.js";
5
+ import * as core from "../../../../core/index.js";
6
+ import * as PaidApi from "../../../index.js";
7
+ export declare namespace Customers {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.PaidApiEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token: core.Supplier<core.BearerToken>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
15
+ }
16
+ interface RequestOptions {
17
+ /** The maximum time to wait for a response in seconds. */
18
+ timeoutInSeconds?: number;
19
+ /** The number of times to retry the request. Defaults to 2. */
20
+ maxRetries?: number;
21
+ /** A hook to abort the request. */
22
+ abortSignal?: AbortSignal;
23
+ /** Additional headers to include in the request. */
24
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
25
+ }
26
+ }
27
+ export declare class Customers {
28
+ protected readonly _options: Customers.Options;
29
+ constructor(_options: Customers.Options);
30
+ /**
31
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
32
+ *
33
+ * @example
34
+ * await client.customers.list()
35
+ */
36
+ list(requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<PaidApi.Customer[]>;
37
+ private __list;
38
+ /**
39
+ * @param {PaidApi.CustomerCreate} request
40
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @example
43
+ * await client.customers.create({
44
+ * name: "name"
45
+ * })
46
+ */
47
+ create(request: PaidApi.CustomerCreate, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<PaidApi.Customer>;
48
+ private __create;
49
+ /**
50
+ * @param {string} customerId
51
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @example
54
+ * await client.customers.get("customerId")
55
+ */
56
+ get(customerId: string, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<PaidApi.Customer>;
57
+ private __get;
58
+ /**
59
+ * @param {string} customerId
60
+ * @param {PaidApi.CustomerUpdate} request
61
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @example
64
+ * await client.customers.update("customerId", {})
65
+ */
66
+ update(customerId: string, request: PaidApi.CustomerUpdate, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<PaidApi.Customer>;
67
+ private __update;
68
+ /**
69
+ * @param {string} customerId
70
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
71
+ *
72
+ * @example
73
+ * await client.customers.delete("customerId")
74
+ */
75
+ delete(customerId: string, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<void>;
76
+ private __delete;
77
+ /**
78
+ * @param {string} externalId
79
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
80
+ *
81
+ * @example
82
+ * await client.customers.getByExternalId("externalId")
83
+ */
84
+ getByExternalId(externalId: string, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<PaidApi.Customer>;
85
+ private __getByExternalId;
86
+ /**
87
+ * @param {string} externalId
88
+ * @param {PaidApi.CustomerUpdate} request
89
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
90
+ *
91
+ * @example
92
+ * await client.customers.updateByExternalId("externalId", {})
93
+ */
94
+ updateByExternalId(externalId: string, request: PaidApi.CustomerUpdate, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<PaidApi.Customer>;
95
+ private __updateByExternalId;
96
+ /**
97
+ * @param {string} externalId
98
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
99
+ *
100
+ * @example
101
+ * await client.customers.deleteByExternalId("externalId")
102
+ */
103
+ deleteByExternalId(externalId: string, requestOptions?: Customers.RequestOptions): core.HttpResponsePromise<void>;
104
+ private __deleteByExternalId;
105
+ protected _getAuthorizationHeader(): Promise<string>;
106
+ }