@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,326 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments.mjs";
14
+ import * as core from "../../../../core/index.mjs";
15
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
16
+ import urlJoin from "url-join";
17
+ import * as errors from "../../../../errors/index.mjs";
18
+ export class Contacts {
19
+ constructor(_options) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
24
+ *
25
+ * @example
26
+ * await client.contacts.list()
27
+ */
28
+ list(requestOptions) {
29
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
30
+ }
31
+ __list(requestOptions) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ var _a, _b, _c;
34
+ const _response = yield core.fetcher({
35
+ url: urlJoin((_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"),
36
+ method: "GET",
37
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
38
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
39
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
40
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
41
+ });
42
+ if (_response.ok) {
43
+ return { data: _response.body, rawResponse: _response.rawResponse };
44
+ }
45
+ if (_response.error.reason === "status-code") {
46
+ throw new errors.PaidApiError({
47
+ statusCode: _response.error.statusCode,
48
+ body: _response.error.body,
49
+ rawResponse: _response.rawResponse,
50
+ });
51
+ }
52
+ switch (_response.error.reason) {
53
+ case "non-json":
54
+ throw new errors.PaidApiError({
55
+ statusCode: _response.error.statusCode,
56
+ body: _response.error.rawBody,
57
+ rawResponse: _response.rawResponse,
58
+ });
59
+ case "timeout":
60
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /contacts.");
61
+ case "unknown":
62
+ throw new errors.PaidApiError({
63
+ message: _response.error.errorMessage,
64
+ rawResponse: _response.rawResponse,
65
+ });
66
+ }
67
+ });
68
+ }
69
+ /**
70
+ * @param {PaidApi.ContactCreate} request
71
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
72
+ *
73
+ * @example
74
+ * await client.contacts.create({
75
+ * salutation: "Mr.",
76
+ * firstName: "firstName",
77
+ * lastName: "lastName",
78
+ * email: "email",
79
+ * billingStreet: "billingStreet",
80
+ * billingCity: "billingCity",
81
+ * billingCountry: "billingCountry",
82
+ * billingPostalCode: "billingPostalCode"
83
+ * })
84
+ */
85
+ create(request, requestOptions) {
86
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
87
+ }
88
+ __create(request, requestOptions) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ var _a, _b, _c;
91
+ const _response = yield core.fetcher({
92
+ url: urlJoin((_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"),
93
+ method: "POST",
94
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
95
+ contentType: "application/json",
96
+ requestType: "json",
97
+ body: request,
98
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
99
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
100
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
101
+ });
102
+ if (_response.ok) {
103
+ return { data: _response.body, rawResponse: _response.rawResponse };
104
+ }
105
+ if (_response.error.reason === "status-code") {
106
+ throw new errors.PaidApiError({
107
+ statusCode: _response.error.statusCode,
108
+ body: _response.error.body,
109
+ rawResponse: _response.rawResponse,
110
+ });
111
+ }
112
+ switch (_response.error.reason) {
113
+ case "non-json":
114
+ throw new errors.PaidApiError({
115
+ statusCode: _response.error.statusCode,
116
+ body: _response.error.rawBody,
117
+ rawResponse: _response.rawResponse,
118
+ });
119
+ case "timeout":
120
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling POST /contacts.");
121
+ case "unknown":
122
+ throw new errors.PaidApiError({
123
+ message: _response.error.errorMessage,
124
+ rawResponse: _response.rawResponse,
125
+ });
126
+ }
127
+ });
128
+ }
129
+ /**
130
+ * @param {string} contactId
131
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @example
134
+ * await client.contacts.get("contactId")
135
+ */
136
+ get(contactId, requestOptions) {
137
+ return core.HttpResponsePromise.fromPromise(this.__get(contactId, requestOptions));
138
+ }
139
+ __get(contactId, requestOptions) {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ var _a, _b, _c;
142
+ const _response = yield core.fetcher({
143
+ url: urlJoin((_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)}`),
144
+ method: "GET",
145
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
146
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
147
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
148
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
149
+ });
150
+ if (_response.ok) {
151
+ return { data: _response.body, rawResponse: _response.rawResponse };
152
+ }
153
+ if (_response.error.reason === "status-code") {
154
+ throw new errors.PaidApiError({
155
+ statusCode: _response.error.statusCode,
156
+ body: _response.error.body,
157
+ rawResponse: _response.rawResponse,
158
+ });
159
+ }
160
+ switch (_response.error.reason) {
161
+ case "non-json":
162
+ throw new errors.PaidApiError({
163
+ statusCode: _response.error.statusCode,
164
+ body: _response.error.rawBody,
165
+ rawResponse: _response.rawResponse,
166
+ });
167
+ case "timeout":
168
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /contacts/{contactId}.");
169
+ case "unknown":
170
+ throw new errors.PaidApiError({
171
+ message: _response.error.errorMessage,
172
+ rawResponse: _response.rawResponse,
173
+ });
174
+ }
175
+ });
176
+ }
177
+ /**
178
+ * @param {string} contactId
179
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
180
+ *
181
+ * @example
182
+ * await client.contacts.delete("contactId")
183
+ */
184
+ delete(contactId, requestOptions) {
185
+ return core.HttpResponsePromise.fromPromise(this.__delete(contactId, requestOptions));
186
+ }
187
+ __delete(contactId, requestOptions) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ var _a, _b, _c;
190
+ const _response = yield core.fetcher({
191
+ url: urlJoin((_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)}`),
192
+ method: "DELETE",
193
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
194
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
195
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
196
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
197
+ });
198
+ if (_response.ok) {
199
+ return { data: undefined, rawResponse: _response.rawResponse };
200
+ }
201
+ if (_response.error.reason === "status-code") {
202
+ throw new errors.PaidApiError({
203
+ statusCode: _response.error.statusCode,
204
+ body: _response.error.body,
205
+ rawResponse: _response.rawResponse,
206
+ });
207
+ }
208
+ switch (_response.error.reason) {
209
+ case "non-json":
210
+ throw new errors.PaidApiError({
211
+ statusCode: _response.error.statusCode,
212
+ body: _response.error.rawBody,
213
+ rawResponse: _response.rawResponse,
214
+ });
215
+ case "timeout":
216
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling DELETE /contacts/{contactId}.");
217
+ case "unknown":
218
+ throw new errors.PaidApiError({
219
+ message: _response.error.errorMessage,
220
+ rawResponse: _response.rawResponse,
221
+ });
222
+ }
223
+ });
224
+ }
225
+ /**
226
+ * @param {string} externalId
227
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
228
+ *
229
+ * @example
230
+ * await client.contacts.getByExternalId("externalId")
231
+ */
232
+ getByExternalId(externalId, requestOptions) {
233
+ return core.HttpResponsePromise.fromPromise(this.__getByExternalId(externalId, requestOptions));
234
+ }
235
+ __getByExternalId(externalId, requestOptions) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ var _a, _b, _c;
238
+ const _response = yield core.fetcher({
239
+ url: urlJoin((_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)}`),
240
+ method: "GET",
241
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
242
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
243
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
244
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
245
+ });
246
+ if (_response.ok) {
247
+ return { data: _response.body, rawResponse: _response.rawResponse };
248
+ }
249
+ if (_response.error.reason === "status-code") {
250
+ throw new errors.PaidApiError({
251
+ statusCode: _response.error.statusCode,
252
+ body: _response.error.body,
253
+ rawResponse: _response.rawResponse,
254
+ });
255
+ }
256
+ switch (_response.error.reason) {
257
+ case "non-json":
258
+ throw new errors.PaidApiError({
259
+ statusCode: _response.error.statusCode,
260
+ body: _response.error.rawBody,
261
+ rawResponse: _response.rawResponse,
262
+ });
263
+ case "timeout":
264
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /contacts/external/{externalId}.");
265
+ case "unknown":
266
+ throw new errors.PaidApiError({
267
+ message: _response.error.errorMessage,
268
+ rawResponse: _response.rawResponse,
269
+ });
270
+ }
271
+ });
272
+ }
273
+ /**
274
+ * @param {string} externalId
275
+ * @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
276
+ *
277
+ * @example
278
+ * await client.contacts.deleteByExternalId("externalId")
279
+ */
280
+ deleteByExternalId(externalId, requestOptions) {
281
+ return core.HttpResponsePromise.fromPromise(this.__deleteByExternalId(externalId, requestOptions));
282
+ }
283
+ __deleteByExternalId(externalId, requestOptions) {
284
+ return __awaiter(this, void 0, void 0, function* () {
285
+ var _a, _b, _c;
286
+ const _response = yield core.fetcher({
287
+ url: urlJoin((_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)}`),
288
+ method: "DELETE",
289
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
290
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
291
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
292
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
293
+ });
294
+ if (_response.ok) {
295
+ return { data: undefined, rawResponse: _response.rawResponse };
296
+ }
297
+ if (_response.error.reason === "status-code") {
298
+ throw new errors.PaidApiError({
299
+ statusCode: _response.error.statusCode,
300
+ body: _response.error.body,
301
+ rawResponse: _response.rawResponse,
302
+ });
303
+ }
304
+ switch (_response.error.reason) {
305
+ case "non-json":
306
+ throw new errors.PaidApiError({
307
+ statusCode: _response.error.statusCode,
308
+ body: _response.error.rawBody,
309
+ rawResponse: _response.rawResponse,
310
+ });
311
+ case "timeout":
312
+ throw new errors.PaidApiTimeoutError("Timeout exceeded when calling DELETE /contacts/external/{externalId}.");
313
+ case "unknown":
314
+ throw new errors.PaidApiError({
315
+ message: _response.error.errorMessage,
316
+ rawResponse: _response.rawResponse,
317
+ });
318
+ }
319
+ });
320
+ }
321
+ _getAuthorizationHeader() {
322
+ return __awaiter(this, void 0, void 0, function* () {
323
+ return `Bearer ${yield core.Supplier.get(this._options.token)}`;
324
+ });
325
+ }
326
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as PaidApi from "../../../../index.mjs";
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,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export { type ContactCreate } from "./ContactCreate.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,106 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.mjs";
5
+ import * as core from "../../../../core/index.mjs";
6
+ import * as PaidApi from "../../../index.mjs";
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
+ }