@usehercules/sdk 1.10.1 → 1.12.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 (423) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +19 -18
  3. package/client.d.mts +12 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +12 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +12 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +12 -3
  10. package/client.mjs.map +1 -1
  11. package/package.json +2 -2
  12. package/resources/{beta/commerce → commerce}/commerce.d.mts +66 -29
  13. package/resources/commerce/commerce.d.mts.map +1 -0
  14. package/resources/{beta/commerce → commerce}/commerce.d.ts +66 -29
  15. package/resources/commerce/commerce.d.ts.map +1 -0
  16. package/resources/{beta/commerce → commerce}/commerce.js +40 -4
  17. package/resources/commerce/commerce.js.map +1 -0
  18. package/resources/{beta/commerce → commerce}/commerce.mjs +39 -3
  19. package/resources/commerce/commerce.mjs.map +1 -0
  20. package/resources/commerce/coupons.d.mts +181 -0
  21. package/resources/commerce/coupons.d.mts.map +1 -0
  22. package/resources/commerce/coupons.d.ts +181 -0
  23. package/resources/commerce/coupons.d.ts.map +1 -0
  24. package/resources/{beta/commerce → commerce}/coupons.js +33 -18
  25. package/resources/commerce/coupons.js.map +1 -0
  26. package/resources/{beta/commerce → commerce}/coupons.mjs +33 -18
  27. package/resources/commerce/coupons.mjs.map +1 -0
  28. package/resources/commerce/customers/balance-transactions.d.mts +4 -0
  29. package/resources/commerce/customers/balance-transactions.d.mts.map +1 -0
  30. package/resources/commerce/customers/balance-transactions.d.ts +4 -0
  31. package/resources/commerce/customers/balance-transactions.d.ts.map +1 -0
  32. package/resources/commerce/customers/balance-transactions.js +9 -0
  33. package/resources/commerce/customers/balance-transactions.js.map +1 -0
  34. package/resources/commerce/customers/balance-transactions.mjs +5 -0
  35. package/resources/commerce/customers/balance-transactions.mjs.map +1 -0
  36. package/resources/{beta/commerce → commerce/customers}/customers.d.mts +75 -251
  37. package/resources/commerce/customers/customers.d.mts.map +1 -0
  38. package/resources/{beta/commerce → commerce/customers}/customers.d.ts +75 -251
  39. package/resources/commerce/customers/customers.d.ts.map +1 -0
  40. package/resources/{beta/commerce → commerce/customers}/customers.js +44 -15
  41. package/resources/commerce/customers/customers.js.map +1 -0
  42. package/resources/{beta/commerce → commerce/customers}/customers.mjs +43 -15
  43. package/resources/commerce/customers/customers.mjs.map +1 -0
  44. package/resources/commerce/customers/index.d.mts +3 -0
  45. package/resources/commerce/customers/index.d.mts.map +1 -0
  46. package/resources/commerce/customers/index.d.ts +3 -0
  47. package/resources/commerce/customers/index.d.ts.map +1 -0
  48. package/resources/commerce/customers/index.js +9 -0
  49. package/resources/commerce/customers/index.js.map +1 -0
  50. package/resources/commerce/customers/index.mjs +4 -0
  51. package/resources/commerce/customers/index.mjs.map +1 -0
  52. package/resources/commerce/customers.d.mts +2 -0
  53. package/resources/commerce/customers.d.mts.map +1 -0
  54. package/resources/commerce/customers.d.ts +2 -0
  55. package/resources/commerce/customers.d.ts.map +1 -0
  56. package/resources/{beta.js → commerce/customers.js} +3 -3
  57. package/resources/commerce/customers.js.map +1 -0
  58. package/resources/{beta.mjs → commerce/customers.mjs} +2 -2
  59. package/resources/commerce/customers.mjs.map +1 -0
  60. package/resources/commerce/features.d.mts +152 -0
  61. package/resources/commerce/features.d.mts.map +1 -0
  62. package/resources/commerce/features.d.ts +152 -0
  63. package/resources/commerce/features.d.ts.map +1 -0
  64. package/resources/commerce/features.js +68 -0
  65. package/resources/commerce/features.js.map +1 -0
  66. package/resources/commerce/features.mjs +64 -0
  67. package/resources/commerce/features.mjs.map +1 -0
  68. package/resources/commerce/index.d.mts +7 -0
  69. package/resources/commerce/index.d.mts.map +1 -0
  70. package/resources/commerce/index.d.ts +7 -0
  71. package/resources/commerce/index.d.ts.map +1 -0
  72. package/resources/commerce/index.js +17 -0
  73. package/resources/commerce/index.js.map +1 -0
  74. package/resources/{beta/commerce → commerce}/index.mjs +3 -1
  75. package/resources/commerce/index.mjs.map +1 -0
  76. package/resources/commerce/products/index.d.mts +4 -0
  77. package/resources/commerce/products/index.d.mts.map +1 -0
  78. package/resources/commerce/products/index.d.ts +4 -0
  79. package/resources/commerce/products/index.d.ts.map +1 -0
  80. package/resources/commerce/products/index.js.map +1 -0
  81. package/resources/commerce/products/index.mjs.map +1 -0
  82. package/resources/commerce/products/products.d.mts +393 -0
  83. package/resources/commerce/products/products.d.mts.map +1 -0
  84. package/resources/commerce/products/products.d.ts +393 -0
  85. package/resources/commerce/products/products.d.ts.map +1 -0
  86. package/resources/{beta/commerce → commerce}/products/products.js +35 -15
  87. package/resources/commerce/products/products.js.map +1 -0
  88. package/resources/{beta/commerce → commerce}/products/products.mjs +34 -14
  89. package/resources/commerce/products/products.mjs.map +1 -0
  90. package/resources/commerce/products/resources.d.mts +174 -0
  91. package/resources/commerce/products/resources.d.mts.map +1 -0
  92. package/resources/commerce/products/resources.d.ts +174 -0
  93. package/resources/commerce/products/resources.d.ts.map +1 -0
  94. package/resources/commerce/products/resources.js +65 -0
  95. package/resources/commerce/products/resources.js.map +1 -0
  96. package/resources/commerce/products/resources.mjs +61 -0
  97. package/resources/commerce/products/resources.mjs.map +1 -0
  98. package/resources/commerce/products/variants.d.mts +294 -0
  99. package/resources/commerce/products/variants.d.mts.map +1 -0
  100. package/resources/commerce/products/variants.d.ts +294 -0
  101. package/resources/commerce/products/variants.d.ts.map +1 -0
  102. package/resources/{beta/commerce → commerce}/products/variants.js +43 -12
  103. package/resources/commerce/products/variants.js.map +1 -0
  104. package/resources/{beta/commerce → commerce}/products/variants.mjs +43 -12
  105. package/resources/commerce/products/variants.mjs.map +1 -0
  106. package/resources/commerce/products.d.mts.map +1 -0
  107. package/resources/commerce/products.d.ts.map +1 -0
  108. package/resources/{beta/commerce → commerce}/products.js +1 -1
  109. package/resources/commerce/products.js.map +1 -0
  110. package/resources/commerce/products.mjs.map +1 -0
  111. package/resources/commerce/subscription-groups.d.mts +4 -0
  112. package/resources/commerce/subscription-groups.d.mts.map +1 -0
  113. package/resources/commerce/subscription-groups.d.ts +4 -0
  114. package/resources/commerce/subscription-groups.d.ts.map +1 -0
  115. package/resources/commerce/subscription-groups.js +9 -0
  116. package/resources/commerce/subscription-groups.js.map +1 -0
  117. package/resources/commerce/subscription-groups.mjs +5 -0
  118. package/resources/commerce/subscription-groups.mjs.map +1 -0
  119. package/resources/commerce.d.mts.map +1 -0
  120. package/resources/{beta/commerce.d.ts.map → commerce.d.ts.map} +1 -1
  121. package/resources/{beta/commerce.js → commerce.js} +1 -1
  122. package/resources/commerce.js.map +1 -0
  123. package/resources/commerce.mjs.map +1 -0
  124. package/resources/{beta/content → content}/assets.d.mts +5 -5
  125. package/resources/content/assets.d.mts.map +1 -0
  126. package/resources/{beta/content → content}/assets.d.ts +5 -5
  127. package/resources/content/assets.d.ts.map +1 -0
  128. package/resources/{beta/content → content}/assets.js +4 -4
  129. package/resources/content/assets.js.map +1 -0
  130. package/resources/{beta/content → content}/assets.mjs +4 -4
  131. package/resources/content/assets.mjs.map +1 -0
  132. package/resources/{beta/content → content}/content.d.mts +4 -1
  133. package/resources/content/content.d.mts.map +1 -0
  134. package/resources/{beta/content → content}/content.d.ts +4 -1
  135. package/resources/content/content.d.ts.map +1 -0
  136. package/resources/{beta/content → content}/content.js +5 -2
  137. package/resources/content/content.js.map +1 -0
  138. package/resources/{beta/content → content}/content.mjs +4 -1
  139. package/resources/content/content.mjs.map +1 -0
  140. package/resources/{beta/content → content}/entries.d.mts +5 -5
  141. package/resources/content/entries.d.mts.map +1 -0
  142. package/resources/{beta/content → content}/entries.d.ts +5 -5
  143. package/resources/content/entries.d.ts.map +1 -0
  144. package/resources/{beta/content → content}/entries.js +3 -3
  145. package/resources/content/entries.js.map +1 -0
  146. package/resources/{beta/content → content}/entries.mjs +3 -3
  147. package/resources/content/entries.mjs.map +1 -0
  148. package/resources/content/index.d.mts.map +1 -0
  149. package/resources/content/index.d.ts.map +1 -0
  150. package/resources/content/index.js.map +1 -0
  151. package/resources/content/index.mjs.map +1 -0
  152. package/resources/{beta/content → content}/locales.d.mts +6 -6
  153. package/resources/content/locales.d.mts.map +1 -0
  154. package/resources/{beta/content → content}/locales.d.ts +6 -6
  155. package/resources/content/locales.d.ts.map +1 -0
  156. package/resources/{beta/content → content}/locales.js +4 -4
  157. package/resources/content/locales.js.map +1 -0
  158. package/resources/{beta/content → content}/locales.mjs +4 -4
  159. package/resources/content/locales.mjs.map +1 -0
  160. package/resources/{beta/content → content}/models/fields.d.mts +6 -6
  161. package/resources/content/models/fields.d.mts.map +1 -0
  162. package/resources/{beta/content → content}/models/fields.d.ts +6 -6
  163. package/resources/content/models/fields.d.ts.map +1 -0
  164. package/resources/{beta/content → content}/models/fields.js +3 -3
  165. package/resources/content/models/fields.js.map +1 -0
  166. package/resources/{beta/content → content}/models/fields.mjs +3 -3
  167. package/resources/content/models/fields.mjs.map +1 -0
  168. package/resources/content/models/index.d.mts.map +1 -0
  169. package/resources/content/models/index.d.ts.map +1 -0
  170. package/resources/content/models/index.js.map +1 -0
  171. package/resources/content/models/index.mjs.map +1 -0
  172. package/resources/{beta/content → content}/models/models.d.mts +10 -10
  173. package/resources/content/models/models.d.mts.map +1 -0
  174. package/resources/{beta/content → content}/models/models.d.ts +10 -10
  175. package/resources/content/models/models.d.ts.map +1 -0
  176. package/resources/{beta/content → content}/models/models.js +4 -4
  177. package/resources/content/models/models.js.map +1 -0
  178. package/resources/{beta/content → content}/models/models.mjs +3 -3
  179. package/resources/content/models/models.mjs.map +1 -0
  180. package/resources/content/models.d.mts.map +1 -0
  181. package/resources/content/models.d.ts.map +1 -0
  182. package/resources/{beta/content → content}/models.js +1 -1
  183. package/resources/content/models.js.map +1 -0
  184. package/resources/content/models.mjs.map +1 -0
  185. package/resources/content/releases/index.d.mts.map +1 -0
  186. package/resources/content/releases/index.d.ts.map +1 -0
  187. package/resources/content/releases/index.js.map +1 -0
  188. package/resources/content/releases/index.mjs.map +1 -0
  189. package/resources/{beta/content → content}/releases/items.d.mts +3 -3
  190. package/resources/content/releases/items.d.mts.map +1 -0
  191. package/resources/{beta/content → content}/releases/items.d.ts +3 -3
  192. package/resources/content/releases/items.d.ts.map +1 -0
  193. package/resources/{beta/content → content}/releases/items.js +3 -3
  194. package/resources/content/releases/items.js.map +1 -0
  195. package/resources/{beta/content → content}/releases/items.mjs +3 -3
  196. package/resources/content/releases/items.mjs.map +1 -0
  197. package/resources/{beta/content → content}/releases/releases.d.mts +6 -6
  198. package/resources/content/releases/releases.d.mts.map +1 -0
  199. package/resources/{beta/content → content}/releases/releases.d.ts +6 -6
  200. package/resources/content/releases/releases.d.ts.map +1 -0
  201. package/resources/{beta/content → content}/releases/releases.js +5 -5
  202. package/resources/content/releases/releases.js.map +1 -0
  203. package/resources/{beta/content → content}/releases/releases.mjs +4 -4
  204. package/resources/content/releases/releases.mjs.map +1 -0
  205. package/resources/content/releases.d.mts.map +1 -0
  206. package/resources/content/releases.d.ts.map +1 -0
  207. package/resources/{beta/content → content}/releases.js +1 -1
  208. package/resources/content/releases.js.map +1 -0
  209. package/resources/content/releases.mjs.map +1 -0
  210. package/resources/{beta/content.d.mts.map → content.d.mts.map} +1 -1
  211. package/resources/{beta/content.d.ts.map → content.d.ts.map} +1 -1
  212. package/resources/{beta/content.js → content.js} +1 -1
  213. package/resources/content.js.map +1 -0
  214. package/resources/content.mjs.map +1 -0
  215. package/resources/index.d.mts +2 -1
  216. package/resources/index.d.mts.map +1 -1
  217. package/resources/index.d.ts +2 -1
  218. package/resources/index.d.ts.map +1 -1
  219. package/resources/index.js +5 -3
  220. package/resources/index.js.map +1 -1
  221. package/resources/index.mjs +2 -1
  222. package/resources/index.mjs.map +1 -1
  223. package/src/client.ts +31 -4
  224. package/src/resources/{beta/commerce → commerce}/commerce.ts +96 -56
  225. package/src/resources/commerce/coupons.ts +236 -0
  226. package/src/resources/commerce/customers/balance-transactions.ts +5 -0
  227. package/src/resources/{beta/commerce → commerce/customers}/customers.ts +84 -310
  228. package/src/resources/commerce/customers/index.ts +15 -0
  229. package/src/resources/{beta.ts → commerce/customers.ts} +1 -1
  230. package/src/resources/commerce/features.ts +193 -0
  231. package/src/resources/{beta/commerce → commerce}/index.ts +17 -16
  232. package/src/resources/{beta/commerce → commerce}/products/index.ts +5 -14
  233. package/src/resources/commerce/products/products.ts +510 -0
  234. package/src/resources/commerce/products/resources.ts +226 -0
  235. package/src/resources/commerce/products/variants.ts +366 -0
  236. package/src/resources/commerce/subscription-groups.ts +5 -0
  237. package/src/resources/{beta/content → content}/assets.ts +7 -7
  238. package/src/resources/{beta/content → content}/content.ts +4 -1
  239. package/src/resources/{beta/content → content}/entries.ts +6 -6
  240. package/src/resources/{beta/content → content}/locales.ts +8 -8
  241. package/src/resources/{beta/content → content}/models/fields.ts +8 -8
  242. package/src/resources/{beta/content → content}/models/models.ts +11 -11
  243. package/src/resources/{beta/content → content}/releases/items.ts +5 -5
  244. package/src/resources/{beta/content → content}/releases/releases.ts +8 -8
  245. package/src/resources/index.ts +10 -1
  246. package/src/version.ts +1 -1
  247. package/version.d.mts +1 -1
  248. package/version.d.ts +1 -1
  249. package/version.js +1 -1
  250. package/version.mjs +1 -1
  251. package/resources/beta/beta.d.mts +0 -14
  252. package/resources/beta/beta.d.mts.map +0 -1
  253. package/resources/beta/beta.d.ts +0 -14
  254. package/resources/beta/beta.d.ts.map +0 -1
  255. package/resources/beta/beta.js +0 -21
  256. package/resources/beta/beta.js.map +0 -1
  257. package/resources/beta/beta.mjs +0 -16
  258. package/resources/beta/beta.mjs.map +0 -1
  259. package/resources/beta/commerce/commerce.d.mts.map +0 -1
  260. package/resources/beta/commerce/commerce.d.ts.map +0 -1
  261. package/resources/beta/commerce/commerce.js.map +0 -1
  262. package/resources/beta/commerce/commerce.mjs.map +0 -1
  263. package/resources/beta/commerce/coupons.d.mts +0 -334
  264. package/resources/beta/commerce/coupons.d.mts.map +0 -1
  265. package/resources/beta/commerce/coupons.d.ts +0 -334
  266. package/resources/beta/commerce/coupons.d.ts.map +0 -1
  267. package/resources/beta/commerce/coupons.js.map +0 -1
  268. package/resources/beta/commerce/coupons.mjs.map +0 -1
  269. package/resources/beta/commerce/customers.d.mts.map +0 -1
  270. package/resources/beta/commerce/customers.d.ts.map +0 -1
  271. package/resources/beta/commerce/customers.js.map +0 -1
  272. package/resources/beta/commerce/customers.mjs.map +0 -1
  273. package/resources/beta/commerce/index.d.mts +0 -5
  274. package/resources/beta/commerce/index.d.mts.map +0 -1
  275. package/resources/beta/commerce/index.d.ts +0 -5
  276. package/resources/beta/commerce/index.d.ts.map +0 -1
  277. package/resources/beta/commerce/index.js +0 -13
  278. package/resources/beta/commerce/index.js.map +0 -1
  279. package/resources/beta/commerce/index.mjs.map +0 -1
  280. package/resources/beta/commerce/products/index.d.mts +0 -4
  281. package/resources/beta/commerce/products/index.d.mts.map +0 -1
  282. package/resources/beta/commerce/products/index.d.ts +0 -4
  283. package/resources/beta/commerce/products/index.d.ts.map +0 -1
  284. package/resources/beta/commerce/products/index.js.map +0 -1
  285. package/resources/beta/commerce/products/index.mjs.map +0 -1
  286. package/resources/beta/commerce/products/products.d.mts +0 -1059
  287. package/resources/beta/commerce/products/products.d.mts.map +0 -1
  288. package/resources/beta/commerce/products/products.d.ts +0 -1059
  289. package/resources/beta/commerce/products/products.d.ts.map +0 -1
  290. package/resources/beta/commerce/products/products.js.map +0 -1
  291. package/resources/beta/commerce/products/products.mjs.map +0 -1
  292. package/resources/beta/commerce/products/resources.d.mts +0 -161
  293. package/resources/beta/commerce/products/resources.d.mts.map +0 -1
  294. package/resources/beta/commerce/products/resources.d.ts +0 -161
  295. package/resources/beta/commerce/products/resources.d.ts.map +0 -1
  296. package/resources/beta/commerce/products/resources.js +0 -41
  297. package/resources/beta/commerce/products/resources.js.map +0 -1
  298. package/resources/beta/commerce/products/resources.mjs +0 -37
  299. package/resources/beta/commerce/products/resources.mjs.map +0 -1
  300. package/resources/beta/commerce/products/variants.d.mts +0 -832
  301. package/resources/beta/commerce/products/variants.d.mts.map +0 -1
  302. package/resources/beta/commerce/products/variants.d.ts +0 -832
  303. package/resources/beta/commerce/products/variants.d.ts.map +0 -1
  304. package/resources/beta/commerce/products/variants.js.map +0 -1
  305. package/resources/beta/commerce/products/variants.mjs.map +0 -1
  306. package/resources/beta/commerce/products.d.mts.map +0 -1
  307. package/resources/beta/commerce/products.d.ts.map +0 -1
  308. package/resources/beta/commerce/products.js.map +0 -1
  309. package/resources/beta/commerce/products.mjs.map +0 -1
  310. package/resources/beta/commerce.d.mts.map +0 -1
  311. package/resources/beta/commerce.js.map +0 -1
  312. package/resources/beta/commerce.mjs.map +0 -1
  313. package/resources/beta/content/assets.d.mts.map +0 -1
  314. package/resources/beta/content/assets.d.ts.map +0 -1
  315. package/resources/beta/content/assets.js.map +0 -1
  316. package/resources/beta/content/assets.mjs.map +0 -1
  317. package/resources/beta/content/content.d.mts.map +0 -1
  318. package/resources/beta/content/content.d.ts.map +0 -1
  319. package/resources/beta/content/content.js.map +0 -1
  320. package/resources/beta/content/content.mjs.map +0 -1
  321. package/resources/beta/content/entries.d.mts.map +0 -1
  322. package/resources/beta/content/entries.d.ts.map +0 -1
  323. package/resources/beta/content/entries.js.map +0 -1
  324. package/resources/beta/content/entries.mjs.map +0 -1
  325. package/resources/beta/content/index.d.mts.map +0 -1
  326. package/resources/beta/content/index.d.ts.map +0 -1
  327. package/resources/beta/content/index.js.map +0 -1
  328. package/resources/beta/content/index.mjs.map +0 -1
  329. package/resources/beta/content/locales.d.mts.map +0 -1
  330. package/resources/beta/content/locales.d.ts.map +0 -1
  331. package/resources/beta/content/locales.js.map +0 -1
  332. package/resources/beta/content/locales.mjs.map +0 -1
  333. package/resources/beta/content/models/fields.d.mts.map +0 -1
  334. package/resources/beta/content/models/fields.d.ts.map +0 -1
  335. package/resources/beta/content/models/fields.js.map +0 -1
  336. package/resources/beta/content/models/fields.mjs.map +0 -1
  337. package/resources/beta/content/models/index.d.mts.map +0 -1
  338. package/resources/beta/content/models/index.d.ts.map +0 -1
  339. package/resources/beta/content/models/index.js.map +0 -1
  340. package/resources/beta/content/models/index.mjs.map +0 -1
  341. package/resources/beta/content/models/models.d.mts.map +0 -1
  342. package/resources/beta/content/models/models.d.ts.map +0 -1
  343. package/resources/beta/content/models/models.js.map +0 -1
  344. package/resources/beta/content/models/models.mjs.map +0 -1
  345. package/resources/beta/content/models.d.mts.map +0 -1
  346. package/resources/beta/content/models.d.ts.map +0 -1
  347. package/resources/beta/content/models.js.map +0 -1
  348. package/resources/beta/content/models.mjs.map +0 -1
  349. package/resources/beta/content/releases/index.d.mts.map +0 -1
  350. package/resources/beta/content/releases/index.d.ts.map +0 -1
  351. package/resources/beta/content/releases/index.js.map +0 -1
  352. package/resources/beta/content/releases/index.mjs.map +0 -1
  353. package/resources/beta/content/releases/items.d.mts.map +0 -1
  354. package/resources/beta/content/releases/items.d.ts.map +0 -1
  355. package/resources/beta/content/releases/items.js.map +0 -1
  356. package/resources/beta/content/releases/items.mjs.map +0 -1
  357. package/resources/beta/content/releases/releases.d.mts.map +0 -1
  358. package/resources/beta/content/releases/releases.d.ts.map +0 -1
  359. package/resources/beta/content/releases/releases.js.map +0 -1
  360. package/resources/beta/content/releases/releases.mjs.map +0 -1
  361. package/resources/beta/content/releases.d.mts.map +0 -1
  362. package/resources/beta/content/releases.d.ts.map +0 -1
  363. package/resources/beta/content/releases.js.map +0 -1
  364. package/resources/beta/content/releases.mjs.map +0 -1
  365. package/resources/beta/content.js.map +0 -1
  366. package/resources/beta/content.mjs.map +0 -1
  367. package/resources/beta/index.d.mts +0 -4
  368. package/resources/beta/index.d.mts.map +0 -1
  369. package/resources/beta/index.d.ts +0 -4
  370. package/resources/beta/index.d.ts.map +0 -1
  371. package/resources/beta/index.js +0 -11
  372. package/resources/beta/index.js.map +0 -1
  373. package/resources/beta/index.mjs +0 -5
  374. package/resources/beta/index.mjs.map +0 -1
  375. package/resources/beta.d.mts +0 -2
  376. package/resources/beta.d.mts.map +0 -1
  377. package/resources/beta.d.ts +0 -2
  378. package/resources/beta.d.ts.map +0 -1
  379. package/resources/beta.js.map +0 -1
  380. package/resources/beta.mjs.map +0 -1
  381. package/src/resources/beta/beta.ts +0 -37
  382. package/src/resources/beta/commerce/coupons.ts +0 -441
  383. package/src/resources/beta/commerce/products/products.ts +0 -1311
  384. package/src/resources/beta/commerce/products/resources.ts +0 -214
  385. package/src/resources/beta/commerce/products/variants.ts +0 -1030
  386. package/src/resources/beta/index.ts +0 -13
  387. /package/resources/{beta/commerce → commerce}/products/index.js +0 -0
  388. /package/resources/{beta/commerce → commerce}/products/index.mjs +0 -0
  389. /package/resources/{beta/commerce → commerce}/products.d.mts +0 -0
  390. /package/resources/{beta/commerce → commerce}/products.d.ts +0 -0
  391. /package/resources/{beta/commerce → commerce}/products.mjs +0 -0
  392. /package/resources/{beta/commerce.d.mts → commerce.d.mts} +0 -0
  393. /package/resources/{beta/commerce.d.ts → commerce.d.ts} +0 -0
  394. /package/resources/{beta/commerce.mjs → commerce.mjs} +0 -0
  395. /package/resources/{beta/content → content}/index.d.mts +0 -0
  396. /package/resources/{beta/content → content}/index.d.ts +0 -0
  397. /package/resources/{beta/content → content}/index.js +0 -0
  398. /package/resources/{beta/content → content}/index.mjs +0 -0
  399. /package/resources/{beta/content → content}/models/index.d.mts +0 -0
  400. /package/resources/{beta/content → content}/models/index.d.ts +0 -0
  401. /package/resources/{beta/content → content}/models/index.js +0 -0
  402. /package/resources/{beta/content → content}/models/index.mjs +0 -0
  403. /package/resources/{beta/content → content}/models.d.mts +0 -0
  404. /package/resources/{beta/content → content}/models.d.ts +0 -0
  405. /package/resources/{beta/content → content}/models.mjs +0 -0
  406. /package/resources/{beta/content → content}/releases/index.d.mts +0 -0
  407. /package/resources/{beta/content → content}/releases/index.d.ts +0 -0
  408. /package/resources/{beta/content → content}/releases/index.js +0 -0
  409. /package/resources/{beta/content → content}/releases/index.mjs +0 -0
  410. /package/resources/{beta/content → content}/releases.d.mts +0 -0
  411. /package/resources/{beta/content → content}/releases.d.ts +0 -0
  412. /package/resources/{beta/content → content}/releases.mjs +0 -0
  413. /package/resources/{beta/content.d.mts → content.d.mts} +0 -0
  414. /package/resources/{beta/content.d.ts → content.d.ts} +0 -0
  415. /package/resources/{beta/content.mjs → content.mjs} +0 -0
  416. /package/src/resources/{beta/commerce → commerce}/products.ts +0 -0
  417. /package/src/resources/{beta/commerce.ts → commerce.ts} +0 -0
  418. /package/src/resources/{beta/content → content}/index.ts +0 -0
  419. /package/src/resources/{beta/content → content}/models/index.ts +0 -0
  420. /package/src/resources/{beta/content → content}/models.ts +0 -0
  421. /package/src/resources/{beta/content → content}/releases/index.ts +0 -0
  422. /package/src/resources/{beta/content → content}/releases.ts +0 -0
  423. /package/src/resources/{beta/content.ts → content.ts} +0 -0
@@ -0,0 +1,294 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../../internal/request-options.mjs";
5
+ export declare class Variants extends APIResource {
6
+ /**
7
+ * Creates a new variant with pricing for a product. Use variants to offer multiple
8
+ * pricing tiers or configurations (e.g., Basic at $10/month, Pro at $25/month). A
9
+ * Stripe Price is automatically created.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const variant =
14
+ * await client.commerce.products.variants.create(
15
+ * 'product_id',
16
+ * { name: 'name' },
17
+ * );
18
+ * ```
19
+ */
20
+ create(productID: string, body: VariantCreateParams, options?: RequestOptions): APIPromise<Variant>;
21
+ /**
22
+ * Updates an existing variant. Use this to modify the name, description, or active
23
+ * status. Pricing cannot be changed after creation—create a new variant instead.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const variant =
28
+ * await client.commerce.products.variants.update(
29
+ * 'variant_id',
30
+ * { product_id: 'product_id' },
31
+ * );
32
+ * ```
33
+ */
34
+ update(variantID: string, params: VariantUpdateParams, options?: RequestOptions): APIPromise<Variant>;
35
+ /**
36
+ * Retrieves all variants for a product. Variants represent different pricing tiers
37
+ * or configurations (e.g., Basic, Pro, Enterprise) within a single product.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * // Automatically fetches more pages as needed.
42
+ * for await (const variant of client.commerce.products.variants.list(
43
+ * 'product_id',
44
+ * )) {
45
+ * // ...
46
+ * }
47
+ * ```
48
+ */
49
+ list(productID: string, query?: VariantListParams | null | undefined, options?: RequestOptions): PagePromise<VariantsCursorIDPage, Variant>;
50
+ /**
51
+ * Retrieves a variant by ID. Returns the variant object including pricing details
52
+ * and status.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const variant = await client.commerce.products.variants.get(
57
+ * 'variant_id',
58
+ * { product_id: 'product_id' },
59
+ * );
60
+ * ```
61
+ */
62
+ get(variantID: string, params: VariantGetParams, options?: RequestOptions): APIPromise<Variant>;
63
+ }
64
+ export type VariantsCursorIDPage = CursorIDPage<Variant>;
65
+ /**
66
+ * A product variant representing a specific tier or configuration. Each variant
67
+ * has its own pricing. Variants allow a single product to have multiple pricing
68
+ * options (e.g., Basic, Pro, Enterprise tiers).
69
+ */
70
+ export interface Variant {
71
+ /**
72
+ * Unique identifier for the variant
73
+ */
74
+ id: string;
75
+ /**
76
+ * Whether the variant is available for new purchases
77
+ */
78
+ active: boolean;
79
+ /**
80
+ * Timestamp when the variant was created
81
+ */
82
+ created: string;
83
+ /**
84
+ * Display name for the variant (e.g., Basic, Standard, Premium)
85
+ */
86
+ name: string;
87
+ /**
88
+ * Three-letter ISO currency code
89
+ */
90
+ currency?: string;
91
+ /**
92
+ * Detailed description of what this variant includes
93
+ */
94
+ description?: string | null;
95
+ /**
96
+ * Media attachments (images, videos) for the variant
97
+ */
98
+ media?: Array<Variant.Media>;
99
+ /**
100
+ * Custom metadata for the variant
101
+ */
102
+ metadata?: {
103
+ [key: string]: unknown;
104
+ };
105
+ /**
106
+ * Recurring billing configuration for subscription variants
107
+ */
108
+ recurring?: Variant.Recurring | null;
109
+ /**
110
+ * Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
111
+ */
112
+ unit_amount?: number;
113
+ }
114
+ export declare namespace Variant {
115
+ /**
116
+ * Media attachment for products or variants
117
+ */
118
+ interface Media {
119
+ /**
120
+ * CDN file ID
121
+ */
122
+ id: string;
123
+ /**
124
+ * Display order in gallery (0-indexed)
125
+ */
126
+ display_order: number;
127
+ /**
128
+ * Type of media: image or video
129
+ */
130
+ type: 'image' | 'video';
131
+ /**
132
+ * CDN URL of the media resource
133
+ */
134
+ url: string;
135
+ /**
136
+ * File size in bytes
137
+ */
138
+ file_size?: number;
139
+ /**
140
+ * Original filename
141
+ */
142
+ filename?: string;
143
+ /**
144
+ * Optimized thumbnail URL for images
145
+ */
146
+ thumbnail_url?: string;
147
+ }
148
+ /**
149
+ * Recurring billing configuration for subscription variants
150
+ */
151
+ interface Recurring {
152
+ /**
153
+ * Billing frequency: day, week, month, or year
154
+ */
155
+ interval: 'day' | 'week' | 'month' | 'year';
156
+ /**
157
+ * Number of intervals between billings
158
+ */
159
+ interval_count?: number;
160
+ }
161
+ }
162
+ export interface VariantCreateParams {
163
+ /**
164
+ * Display name for the variant (e.g., Basic, Standard, Premium)
165
+ */
166
+ name: string;
167
+ /**
168
+ * Optional custom ID for the variant. Must start with 'var\_'. If not provided,
169
+ * one will be generated.
170
+ */
171
+ id?: string;
172
+ /**
173
+ * Three-letter ISO currency code
174
+ */
175
+ currency?: string;
176
+ /**
177
+ * Detailed description of what this variant includes
178
+ */
179
+ description?: string;
180
+ /**
181
+ * Media attachments by CDN file ID
182
+ */
183
+ media?: Array<VariantCreateParams.Media>;
184
+ /**
185
+ * Custom metadata for the variant
186
+ */
187
+ metadata?: {
188
+ [key: string]: unknown;
189
+ };
190
+ /**
191
+ * Recurring billing configuration for subscription variants
192
+ */
193
+ recurring?: VariantCreateParams.Recurring;
194
+ /**
195
+ * Price amount in the smallest currency unit (e.g., cents). Use 0 for free
196
+ * variants.
197
+ */
198
+ unit_amount?: number;
199
+ }
200
+ export declare namespace VariantCreateParams {
201
+ /**
202
+ * Media input for attaching to products or variants
203
+ */
204
+ interface Media {
205
+ /**
206
+ * CDN file ID from upload
207
+ */
208
+ cdn_file_id: string;
209
+ /**
210
+ * Type of media: image or video
211
+ */
212
+ type: 'image' | 'video';
213
+ /**
214
+ * Display order in gallery (0-indexed)
215
+ */
216
+ display_order?: number;
217
+ }
218
+ /**
219
+ * Recurring billing configuration for subscription variants
220
+ */
221
+ interface Recurring {
222
+ /**
223
+ * Billing frequency: day, week, month, or year
224
+ */
225
+ interval: 'day' | 'week' | 'month' | 'year';
226
+ /**
227
+ * Number of intervals between billings
228
+ */
229
+ interval_count?: number;
230
+ }
231
+ }
232
+ export interface VariantUpdateParams {
233
+ /**
234
+ * Path param: The unique identifier of the product
235
+ */
236
+ product_id: string;
237
+ /**
238
+ * Body param: Whether the variant is available for new purchases
239
+ */
240
+ active?: boolean;
241
+ /**
242
+ * Body param: Detailed description of what this variant includes
243
+ */
244
+ description?: string;
245
+ /**
246
+ * Body param: Replace all media attachments. Pass empty array to remove all media.
247
+ */
248
+ media?: Array<VariantUpdateParams.Media>;
249
+ /**
250
+ * Body param: Custom metadata for the variant
251
+ */
252
+ metadata?: {
253
+ [key: string]: unknown;
254
+ };
255
+ /**
256
+ * Body param: Display name for the variant
257
+ */
258
+ name?: string;
259
+ }
260
+ export declare namespace VariantUpdateParams {
261
+ /**
262
+ * Media input for attaching to products or variants
263
+ */
264
+ interface Media {
265
+ /**
266
+ * CDN file ID from upload
267
+ */
268
+ cdn_file_id: string;
269
+ /**
270
+ * Type of media: image or video
271
+ */
272
+ type: 'image' | 'video';
273
+ /**
274
+ * Display order in gallery (0-indexed)
275
+ */
276
+ display_order?: number;
277
+ }
278
+ }
279
+ export interface VariantListParams extends CursorIDPageParams {
280
+ /**
281
+ * Filter by active status
282
+ */
283
+ active?: boolean;
284
+ }
285
+ export interface VariantGetParams {
286
+ /**
287
+ * The unique identifier of the product
288
+ */
289
+ product_id: string;
290
+ }
291
+ export declare namespace Variants {
292
+ export { type Variant as Variant, type VariantsCursorIDPage as VariantsCursorIDPage, type VariantCreateParams as VariantCreateParams, type VariantUpdateParams as VariantUpdateParams, type VariantListParams as VariantListParams, type VariantGetParams as VariantGetParams, };
293
+ }
294
+ //# sourceMappingURL=variants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.mts","sourceRoot":"","sources":["../../../src/resources/commerce/products/variants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAQrG;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oBAAoB,EAAE,OAAO,CAAC;IAO7C;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAIhG;AAED,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB;;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ACnC;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;QAExB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,294 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class Variants extends APIResource {
6
+ /**
7
+ * Creates a new variant with pricing for a product. Use variants to offer multiple
8
+ * pricing tiers or configurations (e.g., Basic at $10/month, Pro at $25/month). A
9
+ * Stripe Price is automatically created.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const variant =
14
+ * await client.commerce.products.variants.create(
15
+ * 'product_id',
16
+ * { name: 'name' },
17
+ * );
18
+ * ```
19
+ */
20
+ create(productID: string, body: VariantCreateParams, options?: RequestOptions): APIPromise<Variant>;
21
+ /**
22
+ * Updates an existing variant. Use this to modify the name, description, or active
23
+ * status. Pricing cannot be changed after creation—create a new variant instead.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const variant =
28
+ * await client.commerce.products.variants.update(
29
+ * 'variant_id',
30
+ * { product_id: 'product_id' },
31
+ * );
32
+ * ```
33
+ */
34
+ update(variantID: string, params: VariantUpdateParams, options?: RequestOptions): APIPromise<Variant>;
35
+ /**
36
+ * Retrieves all variants for a product. Variants represent different pricing tiers
37
+ * or configurations (e.g., Basic, Pro, Enterprise) within a single product.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * // Automatically fetches more pages as needed.
42
+ * for await (const variant of client.commerce.products.variants.list(
43
+ * 'product_id',
44
+ * )) {
45
+ * // ...
46
+ * }
47
+ * ```
48
+ */
49
+ list(productID: string, query?: VariantListParams | null | undefined, options?: RequestOptions): PagePromise<VariantsCursorIDPage, Variant>;
50
+ /**
51
+ * Retrieves a variant by ID. Returns the variant object including pricing details
52
+ * and status.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const variant = await client.commerce.products.variants.get(
57
+ * 'variant_id',
58
+ * { product_id: 'product_id' },
59
+ * );
60
+ * ```
61
+ */
62
+ get(variantID: string, params: VariantGetParams, options?: RequestOptions): APIPromise<Variant>;
63
+ }
64
+ export type VariantsCursorIDPage = CursorIDPage<Variant>;
65
+ /**
66
+ * A product variant representing a specific tier or configuration. Each variant
67
+ * has its own pricing. Variants allow a single product to have multiple pricing
68
+ * options (e.g., Basic, Pro, Enterprise tiers).
69
+ */
70
+ export interface Variant {
71
+ /**
72
+ * Unique identifier for the variant
73
+ */
74
+ id: string;
75
+ /**
76
+ * Whether the variant is available for new purchases
77
+ */
78
+ active: boolean;
79
+ /**
80
+ * Timestamp when the variant was created
81
+ */
82
+ created: string;
83
+ /**
84
+ * Display name for the variant (e.g., Basic, Standard, Premium)
85
+ */
86
+ name: string;
87
+ /**
88
+ * Three-letter ISO currency code
89
+ */
90
+ currency?: string;
91
+ /**
92
+ * Detailed description of what this variant includes
93
+ */
94
+ description?: string | null;
95
+ /**
96
+ * Media attachments (images, videos) for the variant
97
+ */
98
+ media?: Array<Variant.Media>;
99
+ /**
100
+ * Custom metadata for the variant
101
+ */
102
+ metadata?: {
103
+ [key: string]: unknown;
104
+ };
105
+ /**
106
+ * Recurring billing configuration for subscription variants
107
+ */
108
+ recurring?: Variant.Recurring | null;
109
+ /**
110
+ * Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
111
+ */
112
+ unit_amount?: number;
113
+ }
114
+ export declare namespace Variant {
115
+ /**
116
+ * Media attachment for products or variants
117
+ */
118
+ interface Media {
119
+ /**
120
+ * CDN file ID
121
+ */
122
+ id: string;
123
+ /**
124
+ * Display order in gallery (0-indexed)
125
+ */
126
+ display_order: number;
127
+ /**
128
+ * Type of media: image or video
129
+ */
130
+ type: 'image' | 'video';
131
+ /**
132
+ * CDN URL of the media resource
133
+ */
134
+ url: string;
135
+ /**
136
+ * File size in bytes
137
+ */
138
+ file_size?: number;
139
+ /**
140
+ * Original filename
141
+ */
142
+ filename?: string;
143
+ /**
144
+ * Optimized thumbnail URL for images
145
+ */
146
+ thumbnail_url?: string;
147
+ }
148
+ /**
149
+ * Recurring billing configuration for subscription variants
150
+ */
151
+ interface Recurring {
152
+ /**
153
+ * Billing frequency: day, week, month, or year
154
+ */
155
+ interval: 'day' | 'week' | 'month' | 'year';
156
+ /**
157
+ * Number of intervals between billings
158
+ */
159
+ interval_count?: number;
160
+ }
161
+ }
162
+ export interface VariantCreateParams {
163
+ /**
164
+ * Display name for the variant (e.g., Basic, Standard, Premium)
165
+ */
166
+ name: string;
167
+ /**
168
+ * Optional custom ID for the variant. Must start with 'var\_'. If not provided,
169
+ * one will be generated.
170
+ */
171
+ id?: string;
172
+ /**
173
+ * Three-letter ISO currency code
174
+ */
175
+ currency?: string;
176
+ /**
177
+ * Detailed description of what this variant includes
178
+ */
179
+ description?: string;
180
+ /**
181
+ * Media attachments by CDN file ID
182
+ */
183
+ media?: Array<VariantCreateParams.Media>;
184
+ /**
185
+ * Custom metadata for the variant
186
+ */
187
+ metadata?: {
188
+ [key: string]: unknown;
189
+ };
190
+ /**
191
+ * Recurring billing configuration for subscription variants
192
+ */
193
+ recurring?: VariantCreateParams.Recurring;
194
+ /**
195
+ * Price amount in the smallest currency unit (e.g., cents). Use 0 for free
196
+ * variants.
197
+ */
198
+ unit_amount?: number;
199
+ }
200
+ export declare namespace VariantCreateParams {
201
+ /**
202
+ * Media input for attaching to products or variants
203
+ */
204
+ interface Media {
205
+ /**
206
+ * CDN file ID from upload
207
+ */
208
+ cdn_file_id: string;
209
+ /**
210
+ * Type of media: image or video
211
+ */
212
+ type: 'image' | 'video';
213
+ /**
214
+ * Display order in gallery (0-indexed)
215
+ */
216
+ display_order?: number;
217
+ }
218
+ /**
219
+ * Recurring billing configuration for subscription variants
220
+ */
221
+ interface Recurring {
222
+ /**
223
+ * Billing frequency: day, week, month, or year
224
+ */
225
+ interval: 'day' | 'week' | 'month' | 'year';
226
+ /**
227
+ * Number of intervals between billings
228
+ */
229
+ interval_count?: number;
230
+ }
231
+ }
232
+ export interface VariantUpdateParams {
233
+ /**
234
+ * Path param: The unique identifier of the product
235
+ */
236
+ product_id: string;
237
+ /**
238
+ * Body param: Whether the variant is available for new purchases
239
+ */
240
+ active?: boolean;
241
+ /**
242
+ * Body param: Detailed description of what this variant includes
243
+ */
244
+ description?: string;
245
+ /**
246
+ * Body param: Replace all media attachments. Pass empty array to remove all media.
247
+ */
248
+ media?: Array<VariantUpdateParams.Media>;
249
+ /**
250
+ * Body param: Custom metadata for the variant
251
+ */
252
+ metadata?: {
253
+ [key: string]: unknown;
254
+ };
255
+ /**
256
+ * Body param: Display name for the variant
257
+ */
258
+ name?: string;
259
+ }
260
+ export declare namespace VariantUpdateParams {
261
+ /**
262
+ * Media input for attaching to products or variants
263
+ */
264
+ interface Media {
265
+ /**
266
+ * CDN file ID from upload
267
+ */
268
+ cdn_file_id: string;
269
+ /**
270
+ * Type of media: image or video
271
+ */
272
+ type: 'image' | 'video';
273
+ /**
274
+ * Display order in gallery (0-indexed)
275
+ */
276
+ display_order?: number;
277
+ }
278
+ }
279
+ export interface VariantListParams extends CursorIDPageParams {
280
+ /**
281
+ * Filter by active status
282
+ */
283
+ active?: boolean;
284
+ }
285
+ export interface VariantGetParams {
286
+ /**
287
+ * The unique identifier of the product
288
+ */
289
+ product_id: string;
290
+ }
291
+ export declare namespace Variants {
292
+ export { type Variant as Variant, type VariantsCursorIDPage as VariantsCursorIDPage, type VariantCreateParams as VariantCreateParams, type VariantUpdateParams as VariantUpdateParams, type VariantListParams as VariantListParams, type VariantGetParams as VariantGetParams, };
293
+ }
294
+ //# sourceMappingURL=variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/resources/commerce/products/variants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAQrG;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oBAAoB,EAAE,OAAO,CAAC;IAO7C;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CA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MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEtC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,mBAAmB,CAAC;IACnC;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;QAExB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -2,14 +2,23 @@
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.Variants = void 0;
5
- const resource_1 = require("../../../../core/resource.js");
6
- const pagination_1 = require("../../../../core/pagination.js");
7
- const path_1 = require("../../../../internal/utils/path.js");
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const pagination_1 = require("../../../core/pagination.js");
7
+ const path_1 = require("../../../internal/utils/path.js");
8
8
  class Variants extends resource_1.APIResource {
9
9
  /**
10
10
  * Creates a new variant with pricing for a product. Use variants to offer multiple
11
11
  * pricing tiers or configurations (e.g., Basic at $10/month, Pro at $25/month). A
12
12
  * Stripe Price is automatically created.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const variant =
17
+ * await client.commerce.products.variants.create(
18
+ * 'product_id',
19
+ * { name: 'name' },
20
+ * );
21
+ * ```
13
22
  */
14
23
  create(productID, body, options) {
15
24
  return this._client.post((0, path_1.path) `/v1/commerce/products/${productID}/variants`, { body, ...options });
@@ -17,6 +26,15 @@ class Variants extends resource_1.APIResource {
17
26
  /**
18
27
  * Updates an existing variant. Use this to modify the name, description, or active
19
28
  * status. Pricing cannot be changed after creation—create a new variant instead.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const variant =
33
+ * await client.commerce.products.variants.update(
34
+ * 'variant_id',
35
+ * { product_id: 'product_id' },
36
+ * );
37
+ * ```
20
38
  */
21
39
  update(variantID, params, options) {
22
40
  const { product_id, ...body } = params;
@@ -28,21 +46,34 @@ class Variants extends resource_1.APIResource {
28
46
  /**
29
47
  * Retrieves all variants for a product. Variants represent different pricing tiers
30
48
  * or configurations (e.g., Basic, Pro, Enterprise) within a single product.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * // Automatically fetches more pages as needed.
53
+ * for await (const variant of client.commerce.products.variants.list(
54
+ * 'product_id',
55
+ * )) {
56
+ * // ...
57
+ * }
58
+ * ```
31
59
  */
32
60
  list(productID, query = {}, options) {
33
- return this._client.getAPIList((0, path_1.path) `/v1/commerce/products/${productID}/variants`, (pagination_1.CursorIDPage), { query, ...options });
34
- }
35
- /**
36
- * Archives a variant, preventing new subscriptions. The associated Stripe Price is
37
- * also archived. Existing subscriptions remain active.
38
- */
39
- archive(variantID, params, options) {
40
- const { product_id } = params;
41
- return this._client.delete((0, path_1.path) `/v1/commerce/products/${product_id}/variants/${variantID}`, options);
61
+ return this._client.getAPIList((0, path_1.path) `/v1/commerce/products/${productID}/variants`, (pagination_1.CursorIDPage), {
62
+ query,
63
+ ...options,
64
+ });
42
65
  }
43
66
  /**
44
67
  * Retrieves a variant by ID. Returns the variant object including pricing details
45
68
  * and status.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const variant = await client.commerce.products.variants.get(
73
+ * 'variant_id',
74
+ * { product_id: 'product_id' },
75
+ * );
76
+ * ```
46
77
  */
47
78
  get(variantID, params, options) {
48
79
  const { product_id } = params;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../src/resources/commerce/products/variants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAA8F;AAE9F,0DAAoD;AAEpD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,yBAAyB,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAiB,EAAE,MAA2B,EAAE,OAAwB;QAC7E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,yBAAyB,UAAU,aAAa,SAAS,EAAE,EAAE;YACzF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,SAAiB,EACjB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,yBAAyB,SAAS,WAAW,EAAE,CAAA,yBAAqB,CAAA,EAAE;YACvG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,SAAiB,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,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