@metronome/sdk 0.1.0-beta.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/CHANGELOG.md +227 -0
  2. package/README.md +37 -52
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +25 -15
  9. package/core.js.map +1 -1
  10. package/core.mjs +26 -16
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +10 -42
  13. package/index.d.ts +10 -42
  14. package/index.d.ts.map +1 -1
  15. package/index.js +14 -55
  16. package/index.js.map +1 -1
  17. package/index.mjs +14 -55
  18. package/index.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/pagination.d.ts +1 -0
  21. package/pagination.d.ts.map +1 -1
  22. package/pagination.js +3 -0
  23. package/pagination.js.map +1 -1
  24. package/pagination.mjs +3 -0
  25. package/pagination.mjs.map +1 -1
  26. package/resource.d.ts +1 -1
  27. package/resource.d.ts.map +1 -1
  28. package/resource.js.map +1 -1
  29. package/resource.mjs.map +1 -1
  30. package/resources/index.d.ts +2 -13
  31. package/resources/index.d.ts.map +1 -1
  32. package/resources/index.js +5 -38
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs +2 -13
  35. package/resources/index.mjs.map +1 -1
  36. package/resources/shared.d.ts +512 -24
  37. package/resources/shared.d.ts.map +1 -1
  38. package/resources/{alerts.d.ts → v1/alerts.d.ts} +29 -5
  39. package/resources/v1/alerts.d.ts.map +1 -0
  40. package/resources/v1/alerts.js +40 -0
  41. package/resources/v1/alerts.js.map +1 -0
  42. package/resources/v1/alerts.mjs +36 -0
  43. package/resources/v1/alerts.mjs.map +1 -0
  44. package/resources/{audit-logs.d.ts → v1/audit-logs.d.ts} +11 -3
  45. package/resources/v1/audit-logs.d.ts.map +1 -0
  46. package/resources/{audit-logs.js → v1/audit-logs.js} +4 -4
  47. package/resources/v1/audit-logs.js.map +1 -0
  48. package/resources/{audit-logs.mjs → v1/audit-logs.mjs} +4 -4
  49. package/resources/v1/audit-logs.mjs.map +1 -0
  50. package/resources/{billable-metrics.d.ts → v1/billable-metrics.d.ts} +62 -7
  51. package/resources/v1/billable-metrics.d.ts.map +1 -0
  52. package/resources/v1/billable-metrics.js +84 -0
  53. package/resources/v1/billable-metrics.js.map +1 -0
  54. package/resources/v1/billable-metrics.mjs +79 -0
  55. package/resources/v1/billable-metrics.mjs.map +1 -0
  56. package/resources/{contracts → v1/contracts}/contracts.d.ts +1618 -62
  57. package/resources/v1/contracts/contracts.d.ts.map +1 -0
  58. package/resources/v1/contracts/contracts.js +312 -0
  59. package/resources/v1/contracts/contracts.js.map +1 -0
  60. package/resources/v1/contracts/contracts.mjs +285 -0
  61. package/resources/v1/contracts/contracts.mjs.map +1 -0
  62. package/resources/v1/contracts/index.d.ts +5 -0
  63. package/resources/v1/contracts/index.d.ts.map +1 -0
  64. package/resources/v1/contracts/index.js.map +1 -0
  65. package/resources/v1/contracts/index.mjs.map +1 -0
  66. package/resources/{contracts → v1/contracts}/named-schedules.d.ts +23 -2
  67. package/resources/v1/contracts/named-schedules.d.ts.map +1 -0
  68. package/resources/v1/contracts/named-schedules.js +48 -0
  69. package/resources/v1/contracts/named-schedules.js.map +1 -0
  70. package/resources/v1/contracts/named-schedules.mjs +44 -0
  71. package/resources/v1/contracts/named-schedules.mjs.map +1 -0
  72. package/resources/{contracts → v1/contracts}/products.d.ts +55 -7
  73. package/resources/v1/contracts/products.d.ts.map +1 -0
  74. package/resources/v1/contracts/products.js +84 -0
  75. package/resources/v1/contracts/products.js.map +1 -0
  76. package/resources/v1/contracts/products.mjs +79 -0
  77. package/resources/v1/contracts/products.mjs.map +1 -0
  78. package/resources/{contracts → v1/contracts}/rate-cards/index.d.ts +1 -1
  79. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -0
  80. package/resources/v1/contracts/rate-cards/index.js.map +1 -0
  81. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -0
  82. package/resources/{contracts → v1/contracts}/rate-cards/named-schedules.d.ts +27 -2
  83. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -0
  84. package/resources/v1/contracts/rate-cards/named-schedules.js +52 -0
  85. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -0
  86. package/resources/v1/contracts/rate-cards/named-schedules.mjs +48 -0
  87. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -0
  88. package/resources/{contracts → v1/contracts}/rate-cards/product-orders.d.ts +33 -3
  89. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -0
  90. package/resources/v1/contracts/rate-cards/product-orders.js +54 -0
  91. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -0
  92. package/resources/v1/contracts/rate-cards/product-orders.mjs +50 -0
  93. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -0
  94. package/resources/{contracts → v1/contracts}/rate-cards/rate-cards.d.ts +118 -14
  95. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -0
  96. package/resources/{contracts → v1/contracts}/rate-cards/rate-cards.js +83 -12
  97. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -0
  98. package/resources/v1/contracts/rate-cards/rate-cards.mjs +140 -0
  99. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -0
  100. package/resources/{contracts → v1/contracts}/rate-cards/rates.d.ts +118 -14
  101. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -0
  102. package/resources/v1/contracts/rate-cards/rates.js +106 -0
  103. package/resources/v1/contracts/rate-cards/rates.js.map +1 -0
  104. package/resources/v1/contracts/rate-cards/rates.mjs +101 -0
  105. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -0
  106. package/resources/v1/contracts/rate-cards.d.ts +2 -0
  107. package/resources/v1/contracts/rate-cards.d.ts.map +1 -0
  108. package/resources/v1/contracts/rate-cards.js +19 -0
  109. package/resources/v1/contracts/rate-cards.js.map +1 -0
  110. package/resources/v1/contracts/rate-cards.mjs +3 -0
  111. package/resources/v1/contracts/rate-cards.mjs.map +1 -0
  112. package/resources/v1/contracts.d.ts +2 -0
  113. package/resources/v1/contracts.d.ts.map +1 -0
  114. package/resources/v1/contracts.js +19 -0
  115. package/resources/v1/contracts.js.map +1 -0
  116. package/resources/v1/contracts.mjs +3 -0
  117. package/resources/v1/contracts.mjs.map +1 -0
  118. package/resources/{credit-grants.d.ts → v1/credit-grants.d.ts} +81 -6
  119. package/resources/v1/credit-grants.d.ts.map +1 -0
  120. package/resources/v1/credit-grants.js +89 -0
  121. package/resources/v1/credit-grants.js.map +1 -0
  122. package/resources/v1/credit-grants.mjs +84 -0
  123. package/resources/v1/credit-grants.mjs.map +1 -0
  124. package/resources/{custom-fields.d.ts → v1/custom-fields.d.ts} +53 -9
  125. package/resources/v1/custom-fields.d.ts.map +1 -0
  126. package/resources/{custom-fields.js → v1/custom-fields.js} +42 -7
  127. package/resources/v1/custom-fields.js.map +1 -0
  128. package/resources/{custom-fields.mjs → v1/custom-fields.mjs} +42 -7
  129. package/resources/v1/custom-fields.mjs.map +1 -0
  130. package/resources/{customers → v1/customers}/alerts.d.ts +31 -3
  131. package/resources/v1/customers/alerts.d.ts.map +1 -0
  132. package/resources/v1/customers/alerts.js +56 -0
  133. package/resources/v1/customers/alerts.js.map +1 -0
  134. package/resources/v1/customers/alerts.mjs +52 -0
  135. package/resources/v1/customers/alerts.mjs.map +1 -0
  136. package/resources/{customers → v1/customers}/billing-config.d.ts +33 -2
  137. package/resources/v1/customers/billing-config.d.ts.map +1 -0
  138. package/resources/v1/customers/billing-config.js +65 -0
  139. package/resources/v1/customers/billing-config.js.map +1 -0
  140. package/resources/v1/customers/billing-config.mjs +61 -0
  141. package/resources/v1/customers/billing-config.mjs.map +1 -0
  142. package/resources/{customers → v1/customers}/commits.d.ts +97 -10
  143. package/resources/v1/customers/commits.d.ts.map +1 -0
  144. package/resources/v1/customers/commits.js +82 -0
  145. package/resources/v1/customers/commits.js.map +1 -0
  146. package/resources/v1/customers/commits.mjs +78 -0
  147. package/resources/v1/customers/commits.mjs.map +1 -0
  148. package/resources/{customers → v1/customers}/credits.d.ts +76 -6
  149. package/resources/v1/customers/credits.d.ts.map +1 -0
  150. package/resources/v1/customers/credits.js +67 -0
  151. package/resources/v1/customers/credits.js.map +1 -0
  152. package/resources/v1/customers/credits.mjs +63 -0
  153. package/resources/v1/customers/credits.mjs.map +1 -0
  154. package/resources/{customers → v1/customers}/customers.d.ts +197 -14
  155. package/resources/v1/customers/customers.d.ts.map +1 -0
  156. package/resources/{customers → v1/customers}/customers.js +118 -16
  157. package/resources/v1/customers/customers.js.map +1 -0
  158. package/resources/v1/customers/customers.mjs +228 -0
  159. package/resources/v1/customers/customers.mjs.map +1 -0
  160. package/resources/{customers → v1/customers}/index.d.ts +1 -1
  161. package/resources/v1/customers/index.d.ts.map +1 -0
  162. package/resources/v1/customers/index.js.map +1 -0
  163. package/resources/v1/customers/index.mjs.map +1 -0
  164. package/resources/{customers → v1/customers}/invoices.d.ts +152 -57
  165. package/resources/v1/customers/invoices.d.ts.map +1 -0
  166. package/resources/v1/customers/invoices.js +103 -0
  167. package/resources/v1/customers/invoices.js.map +1 -0
  168. package/resources/v1/customers/invoices.mjs +97 -0
  169. package/resources/v1/customers/invoices.mjs.map +1 -0
  170. package/resources/{customers → v1/customers}/named-schedules.d.ts +23 -2
  171. package/resources/v1/customers/named-schedules.d.ts.map +1 -0
  172. package/resources/v1/customers/named-schedules.js +48 -0
  173. package/resources/v1/customers/named-schedules.js.map +1 -0
  174. package/resources/v1/customers/named-schedules.mjs +44 -0
  175. package/resources/v1/customers/named-schedules.mjs.map +1 -0
  176. package/resources/{customers → v1/customers}/plans.d.ts +50 -5
  177. package/resources/v1/customers/plans.d.ts.map +1 -0
  178. package/resources/v1/customers/plans.js +99 -0
  179. package/resources/v1/customers/plans.js.map +1 -0
  180. package/resources/v1/customers/plans.mjs +93 -0
  181. package/resources/v1/customers/plans.mjs.map +1 -0
  182. package/resources/v1/customers.d.ts +2 -0
  183. package/resources/v1/customers.d.ts.map +1 -0
  184. package/resources/v1/customers.js +19 -0
  185. package/resources/v1/customers.js.map +1 -0
  186. package/resources/v1/customers.mjs +3 -0
  187. package/resources/v1/customers.mjs.map +1 -0
  188. package/resources/{dashboards.d.ts → v1/dashboards.d.ts} +32 -4
  189. package/resources/v1/dashboards.d.ts.map +1 -0
  190. package/resources/v1/dashboards.js +43 -0
  191. package/resources/v1/dashboards.js.map +1 -0
  192. package/resources/v1/dashboards.mjs +39 -0
  193. package/resources/v1/dashboards.mjs.map +1 -0
  194. package/resources/v1/index.d.ts +15 -0
  195. package/resources/v1/index.d.ts.map +1 -0
  196. package/resources/v1/index.js +44 -0
  197. package/resources/v1/index.js.map +1 -0
  198. package/resources/v1/index.mjs +16 -0
  199. package/resources/v1/index.mjs.map +1 -0
  200. package/resources/{invoices.d.ts → v1/invoices.d.ts} +16 -2
  201. package/resources/v1/invoices.d.ts.map +1 -0
  202. package/resources/v1/invoices.js +35 -0
  203. package/resources/v1/invoices.js.map +1 -0
  204. package/resources/v1/invoices.mjs +31 -0
  205. package/resources/v1/invoices.mjs.map +1 -0
  206. package/resources/{plans.d.ts → v1/plans.d.ts} +51 -8
  207. package/resources/v1/plans.d.ts.map +1 -0
  208. package/resources/{plans.js → v1/plans.js} +34 -7
  209. package/resources/v1/plans.js.map +1 -0
  210. package/resources/v1/plans.mjs +74 -0
  211. package/resources/v1/plans.mjs.map +1 -0
  212. package/resources/{pricing-units.d.ts → v1/pricing-units.d.ts} +11 -3
  213. package/resources/v1/pricing-units.d.ts.map +1 -0
  214. package/resources/{pricing-units.js → v1/pricing-units.js} +4 -4
  215. package/resources/v1/pricing-units.js.map +1 -0
  216. package/resources/{pricing-units.mjs → v1/pricing-units.mjs} +4 -4
  217. package/resources/v1/pricing-units.mjs.map +1 -0
  218. package/resources/{services.d.ts → v1/services.d.ts} +7 -2
  219. package/resources/v1/services.d.ts.map +1 -0
  220. package/resources/{services.js → v1/services.js} +7 -2
  221. package/resources/v1/services.js.map +1 -0
  222. package/resources/{services.mjs → v1/services.mjs} +7 -2
  223. package/resources/v1/services.mjs.map +1 -0
  224. package/resources/v1/usage.d.ts +325 -0
  225. package/resources/v1/usage.d.ts.map +1 -0
  226. package/resources/v1/usage.js +92 -0
  227. package/resources/v1/usage.js.map +1 -0
  228. package/resources/v1/usage.mjs +87 -0
  229. package/resources/v1/usage.mjs.map +1 -0
  230. package/resources/v1/v1.d.ts +58 -0
  231. package/resources/v1/v1.d.ts.map +1 -0
  232. package/resources/v1/v1.js +98 -0
  233. package/resources/v1/v1.js.map +1 -0
  234. package/resources/v1/v1.mjs +71 -0
  235. package/resources/v1/v1.mjs.map +1 -0
  236. package/resources/v1.d.ts +2 -0
  237. package/resources/v1.d.ts.map +1 -0
  238. package/resources/v1.js +19 -0
  239. package/resources/v1.js.map +1 -0
  240. package/resources/v1.mjs +3 -0
  241. package/resources/v1.mjs.map +1 -0
  242. package/resources/v2/contracts.d.ts +5955 -0
  243. package/resources/v2/contracts.d.ts.map +1 -0
  244. package/resources/v2/contracts.js +136 -0
  245. package/resources/v2/contracts.js.map +1 -0
  246. package/resources/v2/contracts.mjs +132 -0
  247. package/resources/v2/contracts.mjs.map +1 -0
  248. package/resources/v2/index.d.ts +3 -0
  249. package/resources/v2/index.d.ts.map +1 -0
  250. package/resources/v2/index.js +9 -0
  251. package/resources/v2/index.js.map +1 -0
  252. package/resources/v2/index.mjs +4 -0
  253. package/resources/v2/index.mjs.map +1 -0
  254. package/resources/v2/v2.d.ts +10 -0
  255. package/resources/v2/v2.d.ts.map +1 -0
  256. package/resources/v2/v2.js +39 -0
  257. package/resources/v2/v2.js.map +1 -0
  258. package/resources/v2/v2.mjs +12 -0
  259. package/resources/v2/v2.mjs.map +1 -0
  260. package/resources/v2.d.ts +2 -0
  261. package/resources/v2.d.ts.map +1 -0
  262. package/resources/v2.js +19 -0
  263. package/resources/v2.js.map +1 -0
  264. package/resources/v2.mjs +3 -0
  265. package/resources/v2.mjs.map +1 -0
  266. package/resources/webhooks.js +5 -5
  267. package/resources/webhooks.js.map +1 -1
  268. package/resources/webhooks.mjs +5 -5
  269. package/resources/webhooks.mjs.map +1 -1
  270. package/resources.d.ts +2 -0
  271. package/resources.d.ts.map +1 -0
  272. package/resources.js +18 -0
  273. package/resources.js.map +1 -0
  274. package/resources.mjs +2 -0
  275. package/resources.mjs.map +1 -0
  276. package/src/_shims/auto/runtime-bun.ts +1 -1
  277. package/src/_shims/auto/runtime-node.ts +1 -1
  278. package/src/_shims/auto/runtime.ts +1 -1
  279. package/src/_shims/auto/types-node.ts +1 -1
  280. package/src/_shims/bun-runtime.ts +2 -2
  281. package/src/_shims/index.d.ts +5 -3
  282. package/src/_shims/index.js +5 -1
  283. package/src/_shims/index.mjs +6 -2
  284. package/src/_shims/node-runtime.ts +3 -3
  285. package/src/_shims/registry.ts +1 -1
  286. package/src/_shims/web-runtime.ts +3 -3
  287. package/src/core.ts +49 -21
  288. package/src/error.ts +1 -1
  289. package/src/index.ts +31 -349
  290. package/src/internal/qs/formats.ts +1 -1
  291. package/src/internal/qs/index.ts +3 -3
  292. package/src/internal/qs/stringify.ts +3 -3
  293. package/src/internal/qs/utils.ts +2 -2
  294. package/src/pagination.ts +5 -1
  295. package/src/resource.ts +2 -2
  296. package/src/resources/index.ts +4 -144
  297. package/src/resources/shared.ts +587 -26
  298. package/src/resources/{alerts.ts → v1/alerts.ts} +31 -7
  299. package/src/resources/{audit-logs.ts → v1/audit-logs.ts} +13 -5
  300. package/src/resources/{billable-metrics.ts → v1/billable-metrics.ts} +61 -12
  301. package/src/resources/{contracts → v1/contracts}/contracts.ts +1848 -83
  302. package/src/resources/{contracts → v1/contracts}/index.ts +8 -4
  303. package/src/resources/{contracts → v1/contracts}/named-schedules.ts +25 -4
  304. package/src/resources/{contracts → v1/contracts}/products.ts +58 -14
  305. package/src/resources/{contracts → v1/contracts}/rate-cards/index.ts +6 -4
  306. package/src/resources/{contracts → v1/contracts}/rate-cards/named-schedules.ts +29 -4
  307. package/src/resources/{contracts → v1/contracts}/rate-cards/product-orders.ts +38 -5
  308. package/src/resources/{contracts → v1/contracts}/rate-cards/rate-cards.ts +137 -25
  309. package/src/resources/{contracts → v1/contracts}/rate-cards/rates.ts +105 -17
  310. package/src/resources/v1/contracts/rate-cards.ts +3 -0
  311. package/src/resources/v1/contracts.ts +3 -0
  312. package/src/resources/{credit-grants.ts → v1/credit-grants.ts} +86 -14
  313. package/src/resources/{custom-fields.ts → v1/custom-fields.ts} +62 -14
  314. package/src/resources/{customers → v1/customers}/alerts.ts +35 -6
  315. package/src/resources/{customers → v1/customers}/billing-config.ts +37 -5
  316. package/src/resources/{customers → v1/customers}/commits.ts +100 -13
  317. package/src/resources/{customers → v1/customers}/credits.ts +79 -9
  318. package/src/resources/{customers → v1/customers}/customers.ts +229 -40
  319. package/src/resources/{customers → v1/customers}/index.ts +10 -8
  320. package/src/resources/{customers → v1/customers}/invoices.ts +131 -62
  321. package/src/resources/{customers → v1/customers}/named-schedules.ts +25 -4
  322. package/src/resources/{customers → v1/customers}/plans.ts +55 -9
  323. package/src/resources/v1/customers.ts +3 -0
  324. package/src/resources/{dashboards.ts → v1/dashboards.ts} +31 -5
  325. package/src/resources/v1/index.ts +151 -0
  326. package/src/resources/{invoices.ts → v1/invoices.ts} +18 -4
  327. package/src/resources/{plans.ts → v1/plans.ts} +49 -14
  328. package/src/resources/{pricing-units.ts → v1/pricing-units.ts} +13 -5
  329. package/src/resources/{services.ts → v1/services.ts} +8 -3
  330. package/src/resources/v1/usage.ts +429 -0
  331. package/src/resources/v1/v1.ts +364 -0
  332. package/src/resources/v1.ts +3 -0
  333. package/src/resources/v2/contracts.ts +7677 -0
  334. package/src/resources/v2/index.ts +18 -0
  335. package/src/resources/v2/v2.ts +43 -0
  336. package/src/resources/v2.ts +3 -0
  337. package/src/resources/webhooks.ts +7 -7
  338. package/src/resources.ts +1 -0
  339. package/src/shims/node.ts +3 -3
  340. package/src/shims/web.ts +3 -3
  341. package/src/uploads.ts +4 -4
  342. package/src/version.ts +1 -1
  343. package/version.d.ts +1 -1
  344. package/version.d.ts.map +1 -1
  345. package/version.js +1 -1
  346. package/version.js.map +1 -1
  347. package/version.mjs +1 -1
  348. package/version.mjs.map +1 -1
  349. package/resources/alerts.d.ts.map +0 -1
  350. package/resources/alerts.js +0 -21
  351. package/resources/alerts.js.map +0 -1
  352. package/resources/alerts.mjs +0 -17
  353. package/resources/alerts.mjs.map +0 -1
  354. package/resources/audit-logs.d.ts.map +0 -1
  355. package/resources/audit-logs.js.map +0 -1
  356. package/resources/audit-logs.mjs.map +0 -1
  357. package/resources/billable-metrics.d.ts.map +0 -1
  358. package/resources/billable-metrics.js +0 -43
  359. package/resources/billable-metrics.js.map +0 -1
  360. package/resources/billable-metrics.mjs +0 -38
  361. package/resources/billable-metrics.mjs.map +0 -1
  362. package/resources/contracts/contracts.d.ts.map +0 -1
  363. package/resources/contracts/contracts.js +0 -135
  364. package/resources/contracts/contracts.js.map +0 -1
  365. package/resources/contracts/contracts.mjs +0 -108
  366. package/resources/contracts/contracts.mjs.map +0 -1
  367. package/resources/contracts/index.d.ts +0 -5
  368. package/resources/contracts/index.d.ts.map +0 -1
  369. package/resources/contracts/index.js.map +0 -1
  370. package/resources/contracts/index.mjs.map +0 -1
  371. package/resources/contracts/named-schedules.d.ts.map +0 -1
  372. package/resources/contracts/named-schedules.js +0 -27
  373. package/resources/contracts/named-schedules.js.map +0 -1
  374. package/resources/contracts/named-schedules.mjs +0 -23
  375. package/resources/contracts/named-schedules.mjs.map +0 -1
  376. package/resources/contracts/products.d.ts.map +0 -1
  377. package/resources/contracts/products.js +0 -51
  378. package/resources/contracts/products.js.map +0 -1
  379. package/resources/contracts/products.mjs +0 -46
  380. package/resources/contracts/products.mjs.map +0 -1
  381. package/resources/contracts/rate-cards/index.d.ts.map +0 -1
  382. package/resources/contracts/rate-cards/index.js.map +0 -1
  383. package/resources/contracts/rate-cards/index.mjs.map +0 -1
  384. package/resources/contracts/rate-cards/named-schedules.d.ts.map +0 -1
  385. package/resources/contracts/rate-cards/named-schedules.js +0 -27
  386. package/resources/contracts/rate-cards/named-schedules.js.map +0 -1
  387. package/resources/contracts/rate-cards/named-schedules.mjs +0 -23
  388. package/resources/contracts/rate-cards/named-schedules.mjs.map +0 -1
  389. package/resources/contracts/rate-cards/product-orders.d.ts.map +0 -1
  390. package/resources/contracts/rate-cards/product-orders.js +0 -21
  391. package/resources/contracts/rate-cards/product-orders.js.map +0 -1
  392. package/resources/contracts/rate-cards/product-orders.mjs +0 -17
  393. package/resources/contracts/rate-cards/product-orders.mjs.map +0 -1
  394. package/resources/contracts/rate-cards/rate-cards.d.ts.map +0 -1
  395. package/resources/contracts/rate-cards/rate-cards.js.map +0 -1
  396. package/resources/contracts/rate-cards/rate-cards.mjs +0 -69
  397. package/resources/contracts/rate-cards/rate-cards.mjs.map +0 -1
  398. package/resources/contracts/rate-cards/rates.d.ts.map +0 -1
  399. package/resources/contracts/rate-cards/rates.js +0 -38
  400. package/resources/contracts/rate-cards/rates.js.map +0 -1
  401. package/resources/contracts/rate-cards/rates.mjs +0 -33
  402. package/resources/contracts/rate-cards/rates.mjs.map +0 -1
  403. package/resources/credit-grants.d.ts.map +0 -1
  404. package/resources/credit-grants.js +0 -52
  405. package/resources/credit-grants.js.map +0 -1
  406. package/resources/credit-grants.mjs +0 -47
  407. package/resources/credit-grants.mjs.map +0 -1
  408. package/resources/custom-fields.d.ts.map +0 -1
  409. package/resources/custom-fields.js.map +0 -1
  410. package/resources/custom-fields.mjs.map +0 -1
  411. package/resources/customers/alerts.d.ts.map +0 -1
  412. package/resources/customers/alerts.js +0 -33
  413. package/resources/customers/alerts.js.map +0 -1
  414. package/resources/customers/alerts.mjs +0 -29
  415. package/resources/customers/alerts.mjs.map +0 -1
  416. package/resources/customers/billing-config.d.ts.map +0 -1
  417. package/resources/customers/billing-config.js +0 -38
  418. package/resources/customers/billing-config.js.map +0 -1
  419. package/resources/customers/billing-config.mjs +0 -34
  420. package/resources/customers/billing-config.mjs.map +0 -1
  421. package/resources/customers/commits.d.ts.map +0 -1
  422. package/resources/customers/commits.js +0 -27
  423. package/resources/customers/commits.js.map +0 -1
  424. package/resources/customers/commits.mjs +0 -23
  425. package/resources/customers/commits.mjs.map +0 -1
  426. package/resources/customers/credits.d.ts.map +0 -1
  427. package/resources/customers/credits.js +0 -27
  428. package/resources/customers/credits.js.map +0 -1
  429. package/resources/customers/credits.mjs +0 -23
  430. package/resources/customers/credits.mjs.map +0 -1
  431. package/resources/customers/customers.d.ts.map +0 -1
  432. package/resources/customers/customers.js.map +0 -1
  433. package/resources/customers/customers.mjs +0 -126
  434. package/resources/customers/customers.mjs.map +0 -1
  435. package/resources/customers/index.d.ts.map +0 -1
  436. package/resources/customers/index.js.map +0 -1
  437. package/resources/customers/index.mjs.map +0 -1
  438. package/resources/customers/invoices.d.ts.map +0 -1
  439. package/resources/customers/invoices.js +0 -51
  440. package/resources/customers/invoices.js.map +0 -1
  441. package/resources/customers/invoices.mjs +0 -45
  442. package/resources/customers/invoices.mjs.map +0 -1
  443. package/resources/customers/named-schedules.d.ts.map +0 -1
  444. package/resources/customers/named-schedules.js +0 -27
  445. package/resources/customers/named-schedules.js.map +0 -1
  446. package/resources/customers/named-schedules.mjs +0 -23
  447. package/resources/customers/named-schedules.mjs.map +0 -1
  448. package/resources/customers/plans.d.ts.map +0 -1
  449. package/resources/customers/plans.js +0 -53
  450. package/resources/customers/plans.js.map +0 -1
  451. package/resources/customers/plans.mjs +0 -47
  452. package/resources/customers/plans.mjs.map +0 -1
  453. package/resources/dashboards.d.ts.map +0 -1
  454. package/resources/dashboards.js +0 -17
  455. package/resources/dashboards.js.map +0 -1
  456. package/resources/dashboards.mjs +0 -13
  457. package/resources/dashboards.mjs.map +0 -1
  458. package/resources/invoices.d.ts.map +0 -1
  459. package/resources/invoices.js +0 -21
  460. package/resources/invoices.js.map +0 -1
  461. package/resources/invoices.mjs +0 -17
  462. package/resources/invoices.mjs.map +0 -1
  463. package/resources/plans.d.ts.map +0 -1
  464. package/resources/plans.js.map +0 -1
  465. package/resources/plans.mjs +0 -47
  466. package/resources/plans.mjs.map +0 -1
  467. package/resources/pricing-units.d.ts.map +0 -1
  468. package/resources/pricing-units.js.map +0 -1
  469. package/resources/pricing-units.mjs.map +0 -1
  470. package/resources/services.d.ts.map +0 -1
  471. package/resources/services.js.map +0 -1
  472. package/resources/services.mjs.map +0 -1
  473. package/resources/usage.d.ts +0 -166
  474. package/resources/usage.d.ts.map +0 -1
  475. package/resources/usage.js +0 -49
  476. package/resources/usage.js.map +0 -1
  477. package/resources/usage.mjs +0 -44
  478. package/resources/usage.mjs.map +0 -1
  479. package/src/resources/usage.ts +0 -239
  480. /package/resources/{contracts → v1/contracts}/index.js +0 -0
  481. /package/resources/{contracts → v1/contracts}/index.mjs +0 -0
  482. /package/resources/{contracts → v1/contracts}/rate-cards/index.js +0 -0
  483. /package/resources/{contracts → v1/contracts}/rate-cards/index.mjs +0 -0
  484. /package/resources/{customers → v1/customers}/index.js +0 -0
  485. /package/resources/{customers → v1/customers}/index.mjs +0 -0
@@ -1,31 +1,98 @@
1
- import { APIResource } from "../resource.js";
2
- import * as Core from "../core.js";
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
3
  import * as CreditGrantsAPI from "./credit-grants.js";
4
- import * as Shared from "./shared.js";
5
- import { CursorPage, type CursorPageParams } from "../pagination.js";
4
+ import * as Shared from "../shared.js";
5
+ import { CursorPage, type CursorPageParams } from "../../pagination.js";
6
6
  export declare class CreditGrants extends APIResource {
7
7
  /**
8
8
  * Create a new credit grant
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const creditGrant = await client.v1.creditGrants.create({
13
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
14
+ * expires_at: '2022-04-01T00:00:00Z',
15
+ * grant_amount: {
16
+ * amount: 1000,
17
+ * credit_type_id: '5ae401dc-a648-4b49-9ac3-391bb5bc4d7b',
18
+ * },
19
+ * name: 'Acme Corp Promotional Credit Grant',
20
+ * paid_amount: {
21
+ * amount: 5000,
22
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
23
+ * },
24
+ * priority: 0.5,
25
+ * credit_grant_type: 'trial',
26
+ * effective_at: '2022-02-01T00:00:00Z',
27
+ * reason: 'Incentivize new customer',
28
+ * });
29
+ * ```
9
30
  */
10
31
  create(body: CreditGrantCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreditGrantCreateResponse>;
11
32
  /**
12
33
  * List credit grants. This list does not included voided grants.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // Automatically fetches more pages as needed.
38
+ * for await (const creditGrantListResponse of client.v1.creditGrants.list(
39
+ * {
40
+ * credit_type_ids: [
41
+ * '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
42
+ * ],
43
+ * customer_ids: [
44
+ * 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
45
+ * '0e5b8609-d901-4992-b394-c3c2e3f37b1c',
46
+ * ],
47
+ * effective_before: '2022-02-01T00:00:00Z',
48
+ * not_expiring_before: '2022-02-01T00:00:00Z',
49
+ * },
50
+ * )) {
51
+ * // ...
52
+ * }
53
+ * ```
13
54
  */
14
55
  list(params?: CreditGrantListParams, options?: Core.RequestOptions): Core.PagePromise<CreditGrantListResponsesCursorPage, CreditGrantListResponse>;
15
56
  list(options?: Core.RequestOptions): Core.PagePromise<CreditGrantListResponsesCursorPage, CreditGrantListResponse>;
16
57
  /**
17
58
  * Edit an existing credit grant
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response = await client.v1.creditGrants.edit({
63
+ * id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
64
+ * expires_at: '2022-04-01T00:00:00Z',
65
+ * name: 'Acme Corp Promotional Credit Grant',
66
+ * });
67
+ * ```
18
68
  */
19
69
  edit(body: CreditGrantEditParams, options?: Core.RequestOptions): Core.APIPromise<CreditGrantEditResponse>;
20
70
  /**
21
71
  * Fetches a list of credit ledger entries. Returns lists of ledgers per customer.
22
72
  * Ledger entries are returned in chronological order. Ledger entries associated
23
73
  * with voided credit grants are not included.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const response = await client.v1.creditGrants.listEntries({
78
+ * credit_type_ids: ['2714e483-4ff1-48e4-9e25-ac732e8f24f2'],
79
+ * customer_ids: ['6a37bb88-8538-48c5-b37b-a41c836328bd'],
80
+ * ending_before: '2021-02-01T00:00:00Z',
81
+ * starting_on: '2021-01-01T00:00:00Z',
82
+ * });
83
+ * ```
24
84
  */
25
85
  listEntries(params?: CreditGrantListEntriesParams, options?: Core.RequestOptions): Core.APIPromise<CreditGrantListEntriesResponse>;
26
86
  listEntries(options?: Core.RequestOptions): Core.APIPromise<CreditGrantListEntriesResponse>;
27
87
  /**
28
88
  * Void a credit grant
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const response = await client.v1.creditGrants.void({
93
+ * id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
94
+ * });
95
+ * ```
29
96
  */
30
97
  void(body: CreditGrantVoidParams, options?: Core.RequestOptions): Core.APIPromise<CreditGrantVoidResponse>;
31
98
  }
@@ -89,7 +156,9 @@ export interface CreditGrantListResponse {
89
156
  * before the end of the current billing period.
90
157
  */
91
158
  balance: CreditGrantListResponse.Balance;
92
- custom_fields: Record<string, string>;
159
+ custom_fields: {
160
+ [key: string]: string;
161
+ };
93
162
  /**
94
163
  * the Metronome ID of the customer
95
164
  */
@@ -269,7 +338,9 @@ export interface CreditGrantCreateParams {
269
338
  /**
270
339
  * Custom fields to attach to the credit grant.
271
340
  */
272
- custom_fields?: Record<string, string>;
341
+ custom_fields?: {
342
+ [key: string]: string;
343
+ };
273
344
  /**
274
345
  * The credit grant will only apply to usage or charges dated on or after this
275
346
  * timestamp
@@ -391,6 +462,10 @@ export interface CreditGrantListEntriesParams {
391
462
  * Query param: Cursor that indicates where the next page of results should start.
392
463
  */
393
464
  next_page?: string;
465
+ /**
466
+ * Query param: Ledgers sort order by date, asc or desc. Defaults to asc.
467
+ */
468
+ sort?: 'asc' | 'desc';
394
469
  /**
395
470
  * Body param: A list of Metronome credit type IDs to fetch ledger entries for. If
396
471
  * absent, ledger entries for all credit types will be returned.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credit-grants.d.ts","sourceRoot":"","sources":["../../src/resources/v1/credit-grants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,eAAe,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErE,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CACJ,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAI7C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CACF,MAAM,CAAC,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,kCAAkC,EAAE,uBAAuB,CAAC;IAChF,IAAI,CACF,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,kCAAkC,EAAE,uBAAuB,CAAC;IAiBhF;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAI1G;;;;;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AAuB,EACvD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,kCAAkC,IAAI,kCAAkC,EACxE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CreditGrantListResponsesCursorPage = exports.CreditGrants = void 0;
5
+ const resource_1 = require("../../resource.js");
6
+ const core_1 = require("../../core.js");
7
+ const pagination_1 = require("../../pagination.js");
8
+ class CreditGrants extends resource_1.APIResource {
9
+ /**
10
+ * Create a new credit grant
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const creditGrant = await client.v1.creditGrants.create({
15
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
16
+ * expires_at: '2022-04-01T00:00:00Z',
17
+ * grant_amount: {
18
+ * amount: 1000,
19
+ * credit_type_id: '5ae401dc-a648-4b49-9ac3-391bb5bc4d7b',
20
+ * },
21
+ * name: 'Acme Corp Promotional Credit Grant',
22
+ * paid_amount: {
23
+ * amount: 5000,
24
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
25
+ * },
26
+ * priority: 0.5,
27
+ * credit_grant_type: 'trial',
28
+ * effective_at: '2022-02-01T00:00:00Z',
29
+ * reason: 'Incentivize new customer',
30
+ * });
31
+ * ```
32
+ */
33
+ create(body, options) {
34
+ return this._client.post('/v1/credits/createGrant', { body, ...options });
35
+ }
36
+ list(params = {}, options) {
37
+ if ((0, core_1.isRequestOptions)(params)) {
38
+ return this.list({}, params);
39
+ }
40
+ const { limit, next_page, ...body } = params;
41
+ return this._client.getAPIList('/v1/credits/listGrants', CreditGrantListResponsesCursorPage, {
42
+ query: { limit, next_page },
43
+ body,
44
+ method: 'post',
45
+ ...options,
46
+ });
47
+ }
48
+ /**
49
+ * Edit an existing credit grant
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const response = await client.v1.creditGrants.edit({
54
+ * id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
55
+ * expires_at: '2022-04-01T00:00:00Z',
56
+ * name: 'Acme Corp Promotional Credit Grant',
57
+ * });
58
+ * ```
59
+ */
60
+ edit(body, options) {
61
+ return this._client.post('/v1/credits/editGrant', { body, ...options });
62
+ }
63
+ listEntries(params = {}, options) {
64
+ if ((0, core_1.isRequestOptions)(params)) {
65
+ return this.listEntries({}, params);
66
+ }
67
+ const { next_page, sort, ...body } = params;
68
+ return this._client.post('/v1/credits/listEntries', { query: { next_page, sort }, body, ...options });
69
+ }
70
+ /**
71
+ * Void a credit grant
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const response = await client.v1.creditGrants.void({
76
+ * id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
77
+ * });
78
+ * ```
79
+ */
80
+ void(body, options) {
81
+ return this._client.post('/v1/credits/voidGrant', { body, ...options });
82
+ }
83
+ }
84
+ exports.CreditGrants = CreditGrants;
85
+ class CreditGrantListResponsesCursorPage extends pagination_1.CursorPage {
86
+ }
87
+ exports.CreditGrantListResponsesCursorPage = CreditGrantListResponsesCursorPage;
88
+ CreditGrants.CreditGrantListResponsesCursorPage = CreditGrantListResponsesCursorPage;
89
+ //# sourceMappingURL=credit-grants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credit-grants.js","sourceRoot":"","sources":["../../src/resources/v1/credit-grants.ts"],"names":[],"mappings":";AAAA,s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,yBAAyB,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAA2B,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AA1ID,oCA0IC;AAED,MAAa,kCAAmC,SAAQ,uBAAmC;CAAG;AAA9F,gFAA8F;AA8e9F,YAAY,CAAC,kCAAkC,GAAG,kCAAkC,CAAC"}
@@ -0,0 +1,84 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ import { isRequestOptions } from "../../core.mjs";
4
+ import { CursorPage } from "../../pagination.mjs";
5
+ export class CreditGrants extends APIResource {
6
+ /**
7
+ * Create a new credit grant
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const creditGrant = await client.v1.creditGrants.create({
12
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
13
+ * expires_at: '2022-04-01T00:00:00Z',
14
+ * grant_amount: {
15
+ * amount: 1000,
16
+ * credit_type_id: '5ae401dc-a648-4b49-9ac3-391bb5bc4d7b',
17
+ * },
18
+ * name: 'Acme Corp Promotional Credit Grant',
19
+ * paid_amount: {
20
+ * amount: 5000,
21
+ * credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
22
+ * },
23
+ * priority: 0.5,
24
+ * credit_grant_type: 'trial',
25
+ * effective_at: '2022-02-01T00:00:00Z',
26
+ * reason: 'Incentivize new customer',
27
+ * });
28
+ * ```
29
+ */
30
+ create(body, options) {
31
+ return this._client.post('/v1/credits/createGrant', { body, ...options });
32
+ }
33
+ list(params = {}, options) {
34
+ if (isRequestOptions(params)) {
35
+ return this.list({}, params);
36
+ }
37
+ const { limit, next_page, ...body } = params;
38
+ return this._client.getAPIList('/v1/credits/listGrants', CreditGrantListResponsesCursorPage, {
39
+ query: { limit, next_page },
40
+ body,
41
+ method: 'post',
42
+ ...options,
43
+ });
44
+ }
45
+ /**
46
+ * Edit an existing credit grant
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const response = await client.v1.creditGrants.edit({
51
+ * id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
52
+ * expires_at: '2022-04-01T00:00:00Z',
53
+ * name: 'Acme Corp Promotional Credit Grant',
54
+ * });
55
+ * ```
56
+ */
57
+ edit(body, options) {
58
+ return this._client.post('/v1/credits/editGrant', { body, ...options });
59
+ }
60
+ listEntries(params = {}, options) {
61
+ if (isRequestOptions(params)) {
62
+ return this.listEntries({}, params);
63
+ }
64
+ const { next_page, sort, ...body } = params;
65
+ return this._client.post('/v1/credits/listEntries', { query: { next_page, sort }, body, ...options });
66
+ }
67
+ /**
68
+ * Void a credit grant
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const response = await client.v1.creditGrants.void({
73
+ * id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
74
+ * });
75
+ * ```
76
+ */
77
+ void(body, options) {
78
+ return this._client.post('/v1/credits/voidGrant', { body, ...options });
79
+ }
80
+ }
81
+ export class CreditGrantListResponsesCursorPage extends CursorPage {
82
+ }
83
+ CreditGrants.CreditGrantListResponsesCursorPage = CreditGrantListResponsesCursorPage;
84
+ //# sourceMappingURL=credit-grants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credit-grants.mjs","sourceRoot":"","sources":["../../src/resources/v1/credit-grants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CACJ,IAA6B,E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EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,MAAM,OAAO,kCAAmC,SAAQ,UAAmC;CAAG;AA8e9F,YAAY,CAAC,kCAAkC,GAAG,kCAAkC,CAAC"}
@@ -1,22 +1,55 @@
1
- import { APIResource } from "../resource.js";
2
- import * as Core from "../core.js";
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
3
  export declare class CustomFields extends APIResource {
4
4
  /**
5
5
  * Add a key to the allow list for a given entity. There is a 100 character limit
6
6
  * on custom field keys.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * await client.v1.customFields.addKey({
11
+ * enforce_uniqueness: true,
12
+ * entity: 'customer',
13
+ * key: 'x_account_id',
14
+ * });
15
+ * ```
7
16
  */
8
17
  addKey(body: CustomFieldAddKeyParams, options?: Core.RequestOptions): Core.APIPromise<void>;
9
18
  /**
10
19
  * Deletes one or more custom fields on an instance of a Metronome entity.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * await client.v1.customFields.deleteValues({
24
+ * entity: 'customer',
25
+ * entity_id: '99594816-e8a5-4bca-be21-8d1de0f45120',
26
+ * keys: ['x_account_id'],
27
+ * });
28
+ * ```
11
29
  */
12
30
  deleteValues(body: CustomFieldDeleteValuesParams, options?: Core.RequestOptions): Core.APIPromise<void>;
13
31
  /**
14
32
  * List all active custom field keys, optionally filtered by entity type.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const response = await client.v1.customFields.listKeys({
37
+ * entities: ['customer'],
38
+ * });
39
+ * ```
15
40
  */
16
41
  listKeys(params?: CustomFieldListKeysParams, options?: Core.RequestOptions): Core.APIPromise<CustomFieldListKeysResponse>;
17
42
  listKeys(options?: Core.RequestOptions): Core.APIPromise<CustomFieldListKeysResponse>;
18
43
  /**
19
44
  * Remove a key from the allow list for a given entity.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * await client.v1.customFields.removeKey({
49
+ * entity: 'customer',
50
+ * key: 'x_account_id',
51
+ * });
52
+ * ```
20
53
  */
21
54
  removeKey(body: CustomFieldRemoveKeyParams, options?: Core.RequestOptions): Core.APIPromise<void>;
22
55
  /**
@@ -27,6 +60,15 @@ export declare class CustomFields extends APIResource {
27
60
  * transactional and will update all key/value pairs or no key/value pairs. Partial
28
61
  * updates are not supported. There is a 200 character limit on custom field
29
62
  * values.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * await client.v1.customFields.setValues({
67
+ * custom_fields: { x_account_id: 'KyVnHhSBWl7eY2bl' },
68
+ * entity: 'customer',
69
+ * entity_id: '99594816-e8a5-4bca-be21-8d1de0f45120',
70
+ * });
71
+ * ```
30
72
  */
31
73
  setValues(body: CustomFieldSetValuesParams, options?: Core.RequestOptions): Core.APIPromise<void>;
32
74
  }
@@ -37,17 +79,17 @@ export interface CustomFieldListKeysResponse {
37
79
  export declare namespace CustomFieldListKeysResponse {
38
80
  interface Data {
39
81
  enforce_uniqueness: boolean;
40
- entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge';
82
+ entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge' | 'subscription';
41
83
  key: string;
42
84
  }
43
85
  }
44
86
  export interface CustomFieldAddKeyParams {
45
87
  enforce_uniqueness: boolean;
46
- entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge';
88
+ entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge' | 'subscription';
47
89
  key: string;
48
90
  }
49
91
  export interface CustomFieldDeleteValuesParams {
50
- entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge';
92
+ entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge' | 'subscription';
51
93
  entity_id: string;
52
94
  keys: Array<string>;
53
95
  }
@@ -59,15 +101,17 @@ export interface CustomFieldListKeysParams {
59
101
  /**
60
102
  * Body param: Optional list of entity types to return keys for
61
103
  */
62
- entities?: Array<'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge'>;
104
+ entities?: Array<'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge' | 'subscription'>;
63
105
  }
64
106
  export interface CustomFieldRemoveKeyParams {
65
- entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge';
107
+ entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge' | 'subscription';
66
108
  key: string;
67
109
  }
68
110
  export interface CustomFieldSetValuesParams {
69
- custom_fields: Record<string, string>;
70
- entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge';
111
+ custom_fields: {
112
+ [key: string]: string;
113
+ };
114
+ entity: 'alert' | 'billable_metric' | 'charge' | 'commit' | 'contract_credit' | 'contract_product' | 'contract' | 'credit_grant' | 'customer_plan' | 'customer' | 'discount' | 'invoice' | 'plan' | 'professional_service' | 'product' | 'rate_card' | 'scheduled_charge' | 'subscription';
71
115
  entity_id: string;
72
116
  }
73
117
  export declare namespace CustomFields {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-fields.d.ts","sourceRoot":"","sources":["../../src/resources/v1/custom-fields.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAQ3F;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,IAAI,EAAE,6BAA6B,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAQvG;;;;;;;;;OASG;IACH,QAAQ,CACN,MAAM,CAAC,EAAE,yBAAyB,EAClC,OAAO,CAA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ACR,iBAAiB,GACjB,kBAAkB,GAClB,UAAU,GACV,cAAc,GACd,eAAe,GACf,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,sBAAsB,GACtB,SAAS,GACT,WAAW,GACX,kBAAkB,GAClB,cAAc,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -2,15 +2,24 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.CustomFields = void 0;
5
- const resource_1 = require("../resource.js");
6
- const core_1 = require("../core.js");
5
+ const resource_1 = require("../../resource.js");
6
+ const core_1 = require("../../core.js");
7
7
  class CustomFields extends resource_1.APIResource {
8
8
  /**
9
9
  * Add a key to the allow list for a given entity. There is a 100 character limit
10
10
  * on custom field keys.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * await client.v1.customFields.addKey({
15
+ * enforce_uniqueness: true,
16
+ * entity: 'customer',
17
+ * key: 'x_account_id',
18
+ * });
19
+ * ```
11
20
  */
12
21
  addKey(body, options) {
13
- return this._client.post('/customFields/addKey', {
22
+ return this._client.post('/v1/customFields/addKey', {
14
23
  body,
15
24
  ...options,
16
25
  headers: { Accept: '*/*', ...options?.headers },
@@ -18,9 +27,18 @@ class CustomFields extends resource_1.APIResource {
18
27
  }
19
28
  /**
20
29
  * Deletes one or more custom fields on an instance of a Metronome entity.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * await client.v1.customFields.deleteValues({
34
+ * entity: 'customer',
35
+ * entity_id: '99594816-e8a5-4bca-be21-8d1de0f45120',
36
+ * keys: ['x_account_id'],
37
+ * });
38
+ * ```
21
39
  */
22
40
  deleteValues(body, options) {
23
- return this._client.post('/customFields/deleteValues', {
41
+ return this._client.post('/v1/customFields/deleteValues', {
24
42
  body,
25
43
  ...options,
26
44
  headers: { Accept: '*/*', ...options?.headers },
@@ -31,13 +49,21 @@ class CustomFields extends resource_1.APIResource {
31
49
  return this.listKeys({}, params);
32
50
  }
33
51
  const { next_page, ...body } = params;
34
- return this._client.post('/customFields/listKeys', { query: { next_page }, body, ...options });
52
+ return this._client.post('/v1/customFields/listKeys', { query: { next_page }, body, ...options });
35
53
  }
36
54
  /**
37
55
  * Remove a key from the allow list for a given entity.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * await client.v1.customFields.removeKey({
60
+ * entity: 'customer',
61
+ * key: 'x_account_id',
62
+ * });
63
+ * ```
38
64
  */
39
65
  removeKey(body, options) {
40
- return this._client.post('/customFields/removeKey', {
66
+ return this._client.post('/v1/customFields/removeKey', {
41
67
  body,
42
68
  ...options,
43
69
  headers: { Accept: '*/*', ...options?.headers },
@@ -51,9 +77,18 @@ class CustomFields extends resource_1.APIResource {
51
77
  * transactional and will update all key/value pairs or no key/value pairs. Partial
52
78
  * updates are not supported. There is a 200 character limit on custom field
53
79
  * values.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * await client.v1.customFields.setValues({
84
+ * custom_fields: { x_account_id: 'KyVnHhSBWl7eY2bl' },
85
+ * entity: 'customer',
86
+ * entity_id: '99594816-e8a5-4bca-be21-8d1de0f45120',
87
+ * });
88
+ * ```
54
89
  */
55
90
  setValues(body, options) {
56
- return this._client.post('/customFields/setValues', {
91
+ return this._client.post('/v1/customFields/setValues', {
57
92
  body,
58
93
  ...options,
59
94
  headers: { Accept: '*/*', ...options?.headers },
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-fields.js","sourceRoot":"","sources":["../../src/resources/v1/custom-fields.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E,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,IAAgC,EAAE,OAA6B;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAhHD,oCAgHC"}
@@ -1,13 +1,22 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../resource.mjs";
3
- import { isRequestOptions } from "../core.mjs";
2
+ import { APIResource } from "../../resource.mjs";
3
+ import { isRequestOptions } from "../../core.mjs";
4
4
  export class CustomFields extends APIResource {
5
5
  /**
6
6
  * Add a key to the allow list for a given entity. There is a 100 character limit
7
7
  * on custom field keys.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * await client.v1.customFields.addKey({
12
+ * enforce_uniqueness: true,
13
+ * entity: 'customer',
14
+ * key: 'x_account_id',
15
+ * });
16
+ * ```
8
17
  */
9
18
  addKey(body, options) {
10
- return this._client.post('/customFields/addKey', {
19
+ return this._client.post('/v1/customFields/addKey', {
11
20
  body,
12
21
  ...options,
13
22
  headers: { Accept: '*/*', ...options?.headers },
@@ -15,9 +24,18 @@ export class CustomFields extends APIResource {
15
24
  }
16
25
  /**
17
26
  * Deletes one or more custom fields on an instance of a Metronome entity.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * await client.v1.customFields.deleteValues({
31
+ * entity: 'customer',
32
+ * entity_id: '99594816-e8a5-4bca-be21-8d1de0f45120',
33
+ * keys: ['x_account_id'],
34
+ * });
35
+ * ```
18
36
  */
19
37
  deleteValues(body, options) {
20
- return this._client.post('/customFields/deleteValues', {
38
+ return this._client.post('/v1/customFields/deleteValues', {
21
39
  body,
22
40
  ...options,
23
41
  headers: { Accept: '*/*', ...options?.headers },
@@ -28,13 +46,21 @@ export class CustomFields extends APIResource {
28
46
  return this.listKeys({}, params);
29
47
  }
30
48
  const { next_page, ...body } = params;
31
- return this._client.post('/customFields/listKeys', { query: { next_page }, body, ...options });
49
+ return this._client.post('/v1/customFields/listKeys', { query: { next_page }, body, ...options });
32
50
  }
33
51
  /**
34
52
  * Remove a key from the allow list for a given entity.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * await client.v1.customFields.removeKey({
57
+ * entity: 'customer',
58
+ * key: 'x_account_id',
59
+ * });
60
+ * ```
35
61
  */
36
62
  removeKey(body, options) {
37
- return this._client.post('/customFields/removeKey', {
63
+ return this._client.post('/v1/customFields/removeKey', {
38
64
  body,
39
65
  ...options,
40
66
  headers: { Accept: '*/*', ...options?.headers },
@@ -48,9 +74,18 @@ export class CustomFields extends APIResource {
48
74
  * transactional and will update all key/value pairs or no key/value pairs. Partial
49
75
  * updates are not supported. There is a 200 character limit on custom field
50
76
  * values.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * await client.v1.customFields.setValues({
81
+ * custom_fields: { x_account_id: 'KyVnHhSBWl7eY2bl' },
82
+ * entity: 'customer',
83
+ * entity_id: '99594816-e8a5-4bca-be21-8d1de0f45120',
84
+ * });
85
+ * ```
51
86
  */
52
87
  setValues(body, options) {
53
- return this._client.post('/customFields/setValues', {
88
+ return this._client.post('/v1/customFields/setValues', {
54
89
  body,
55
90
  ...options,
56
91
  headers: { Accept: '*/*', ...options?.headers },
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-fields.mjs","sourceRoot":"","sources":["../../src/resources/v1/custom-fields.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAA6B,EAAE,OAA6B;QACjE,OAAO,IAAI,CAAC,OAAO,C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