@mmailaender/convex-creem 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 (383) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1176 -0
  3. package/dist/client/helpers.d.ts +17 -0
  4. package/dist/client/helpers.d.ts.map +1 -0
  5. package/dist/client/helpers.js +43 -0
  6. package/dist/client/helpers.js.map +1 -0
  7. package/dist/client/index.d.ts +1041 -0
  8. package/dist/client/index.d.ts.map +1 -0
  9. package/dist/client/index.js +1068 -0
  10. package/dist/client/index.js.map +1 -0
  11. package/dist/client/parsers.d.ts +45 -0
  12. package/dist/client/parsers.d.ts.map +1 -0
  13. package/dist/client/parsers.js +138 -0
  14. package/dist/client/parsers.js.map +1 -0
  15. package/dist/client/polyfill.d.ts +2 -0
  16. package/dist/client/polyfill.d.ts.map +1 -0
  17. package/dist/client/polyfill.js +3 -0
  18. package/dist/client/polyfill.js.map +1 -0
  19. package/dist/component/_generated/api.d.ts +36 -0
  20. package/dist/component/_generated/api.d.ts.map +1 -0
  21. package/dist/component/_generated/api.js +31 -0
  22. package/dist/component/_generated/api.js.map +1 -0
  23. package/dist/component/_generated/component.d.ts +542 -0
  24. package/dist/component/_generated/component.d.ts.map +1 -0
  25. package/dist/component/_generated/component.js +11 -0
  26. package/dist/component/_generated/component.js.map +1 -0
  27. package/dist/component/_generated/dataModel.d.ts +46 -0
  28. package/dist/component/_generated/dataModel.d.ts.map +1 -0
  29. package/dist/component/_generated/dataModel.js +11 -0
  30. package/dist/component/_generated/dataModel.js.map +1 -0
  31. package/dist/component/_generated/server.d.ts +121 -0
  32. package/dist/component/_generated/server.d.ts.map +1 -0
  33. package/dist/component/_generated/server.js +78 -0
  34. package/dist/component/_generated/server.js.map +1 -0
  35. package/dist/component/convex.config.d.ts +3 -0
  36. package/dist/component/convex.config.d.ts.map +1 -0
  37. package/dist/component/convex.config.js +3 -0
  38. package/dist/component/convex.config.js.map +1 -0
  39. package/dist/component/lib.d.ts +1005 -0
  40. package/dist/component/lib.d.ts.map +1 -0
  41. package/dist/component/lib.js +647 -0
  42. package/dist/component/lib.js.map +1 -0
  43. package/dist/component/schema.d.ts +191 -0
  44. package/dist/component/schema.d.ts.map +1 -0
  45. package/dist/component/schema.js +104 -0
  46. package/dist/component/schema.js.map +1 -0
  47. package/dist/component/util.d.ts +61 -0
  48. package/dist/component/util.d.ts.map +1 -0
  49. package/dist/component/util.js +142 -0
  50. package/dist/component/util.js.map +1 -0
  51. package/dist/core/catalog.d.ts +18 -0
  52. package/dist/core/catalog.d.ts.map +1 -0
  53. package/dist/core/catalog.js +82 -0
  54. package/dist/core/catalog.js.map +1 -0
  55. package/dist/core/index.d.ts +9 -0
  56. package/dist/core/index.d.ts.map +1 -0
  57. package/dist/core/index.js +9 -0
  58. package/dist/core/index.js.map +1 -0
  59. package/dist/core/markdown.d.ts +12 -0
  60. package/dist/core/markdown.d.ts.map +1 -0
  61. package/dist/core/markdown.js +26 -0
  62. package/dist/core/markdown.js.map +1 -0
  63. package/dist/core/payments.d.ts +11 -0
  64. package/dist/core/payments.d.ts.map +1 -0
  65. package/dist/core/payments.js +27 -0
  66. package/dist/core/payments.js.map +1 -0
  67. package/dist/core/pendingCheckout.d.ts +15 -0
  68. package/dist/core/pendingCheckout.d.ts.map +1 -0
  69. package/dist/core/pendingCheckout.js +40 -0
  70. package/dist/core/pendingCheckout.js.map +1 -0
  71. package/dist/core/resolver.d.ts +11 -0
  72. package/dist/core/resolver.d.ts.map +1 -0
  73. package/dist/core/resolver.js +106 -0
  74. package/dist/core/resolver.js.map +1 -0
  75. package/dist/core/selectors.d.ts +12 -0
  76. package/dist/core/selectors.d.ts.map +1 -0
  77. package/dist/core/selectors.js +18 -0
  78. package/dist/core/selectors.js.map +1 -0
  79. package/dist/core/subscriptionUpdate.d.ts +20 -0
  80. package/dist/core/subscriptionUpdate.d.ts.map +1 -0
  81. package/dist/core/subscriptionUpdate.js +64 -0
  82. package/dist/core/subscriptionUpdate.js.map +1 -0
  83. package/dist/core/types.d.ts +170 -0
  84. package/dist/core/types.d.ts.map +1 -0
  85. package/dist/core/types.js +15 -0
  86. package/dist/core/types.js.map +1 -0
  87. package/dist/design-system/colors/color-utils.d.ts +10 -0
  88. package/dist/design-system/colors/color-utils.d.ts.map +1 -0
  89. package/dist/design-system/colors/color-utils.js +91 -0
  90. package/dist/design-system/colors/color-utils.js.map +1 -0
  91. package/dist/design-system/colors/config.d.ts +33 -0
  92. package/dist/design-system/colors/config.d.ts.map +1 -0
  93. package/dist/design-system/colors/config.js +224 -0
  94. package/dist/design-system/colors/config.js.map +1 -0
  95. package/dist/design-system/colors/index.d.ts +3 -0
  96. package/dist/design-system/colors/index.d.ts.map +1 -0
  97. package/dist/design-system/colors/index.js +3 -0
  98. package/dist/design-system/colors/index.js.map +1 -0
  99. package/dist/design-system/rounded/config.d.ts +31 -0
  100. package/dist/design-system/rounded/config.d.ts.map +1 -0
  101. package/dist/design-system/rounded/config.js +76 -0
  102. package/dist/design-system/rounded/config.js.map +1 -0
  103. package/dist/design-system/rounded/index.d.ts +2 -0
  104. package/dist/design-system/rounded/index.d.ts.map +1 -0
  105. package/dist/design-system/rounded/index.js +2 -0
  106. package/dist/design-system/rounded/index.js.map +1 -0
  107. package/dist/design-system/typography/config.d.ts +55 -0
  108. package/dist/design-system/typography/config.d.ts.map +1 -0
  109. package/dist/design-system/typography/config.js +308 -0
  110. package/dist/design-system/typography/config.js.map +1 -0
  111. package/dist/design-system/typography/index.d.ts +3 -0
  112. package/dist/design-system/typography/index.d.ts.map +1 -0
  113. package/dist/design-system/typography/index.js +3 -0
  114. package/dist/design-system/typography/index.js.map +1 -0
  115. package/dist/design-system/typography/tokens.d.ts +23 -0
  116. package/dist/design-system/typography/tokens.d.ts.map +1 -0
  117. package/dist/design-system/typography/tokens.js +99 -0
  118. package/dist/design-system/typography/tokens.js.map +1 -0
  119. package/dist/react/hooks/useCheckoutSuccessParams.d.ts +2 -0
  120. package/dist/react/hooks/useCheckoutSuccessParams.d.ts.map +1 -0
  121. package/dist/react/hooks/useCheckoutSuccessParams.js +5 -0
  122. package/dist/react/hooks/useCheckoutSuccessParams.js.map +1 -0
  123. package/dist/react/index.d.ts +25 -0
  124. package/dist/react/index.d.ts.map +1 -0
  125. package/dist/react/index.js +22 -0
  126. package/dist/react/index.js.map +1 -0
  127. package/dist/react/primitives/BillingGate.d.ts +8 -0
  128. package/dist/react/primitives/BillingGate.d.ts.map +1 -0
  129. package/dist/react/primitives/BillingGate.js +13 -0
  130. package/dist/react/primitives/BillingGate.js.map +1 -0
  131. package/dist/react/primitives/BillingToggle.d.ts +8 -0
  132. package/dist/react/primitives/BillingToggle.d.ts.map +1 -0
  133. package/dist/react/primitives/BillingToggle.js +12 -0
  134. package/dist/react/primitives/BillingToggle.js.map +1 -0
  135. package/dist/react/primitives/CheckoutButton.d.ts +11 -0
  136. package/dist/react/primitives/CheckoutButton.d.ts.map +1 -0
  137. package/dist/react/primitives/CheckoutButton.js +21 -0
  138. package/dist/react/primitives/CheckoutButton.js.map +1 -0
  139. package/dist/react/primitives/CheckoutSuccessSummary.d.ts +7 -0
  140. package/dist/react/primitives/CheckoutSuccessSummary.d.ts.map +1 -0
  141. package/dist/react/primitives/CheckoutSuccessSummary.js +11 -0
  142. package/dist/react/primitives/CheckoutSuccessSummary.js.map +1 -0
  143. package/dist/react/primitives/CustomerPortalButton.d.ts +8 -0
  144. package/dist/react/primitives/CustomerPortalButton.d.ts.map +1 -0
  145. package/dist/react/primitives/CustomerPortalButton.js +21 -0
  146. package/dist/react/primitives/CustomerPortalButton.js.map +1 -0
  147. package/dist/react/primitives/NumberInput.d.ts +11 -0
  148. package/dist/react/primitives/NumberInput.d.ts.map +1 -0
  149. package/dist/react/primitives/NumberInput.js +18 -0
  150. package/dist/react/primitives/NumberInput.js.map +1 -0
  151. package/dist/react/primitives/OneTimeCheckoutButton.d.ts +11 -0
  152. package/dist/react/primitives/OneTimeCheckoutButton.d.ts.map +1 -0
  153. package/dist/react/primitives/OneTimeCheckoutButton.js +4 -0
  154. package/dist/react/primitives/OneTimeCheckoutButton.js.map +1 -0
  155. package/dist/react/primitives/OneTimePaymentStatusBadge.d.ts +6 -0
  156. package/dist/react/primitives/OneTimePaymentStatusBadge.d.ts.map +1 -0
  157. package/dist/react/primitives/OneTimePaymentStatusBadge.js +11 -0
  158. package/dist/react/primitives/OneTimePaymentStatusBadge.js.map +1 -0
  159. package/dist/react/primitives/PaymentWarningBanner.d.ts +7 -0
  160. package/dist/react/primitives/PaymentWarningBanner.d.ts.map +1 -0
  161. package/dist/react/primitives/PaymentWarningBanner.js +18 -0
  162. package/dist/react/primitives/PaymentWarningBanner.js.map +1 -0
  163. package/dist/react/primitives/PricingCard.d.ts +37 -0
  164. package/dist/react/primitives/PricingCard.d.ts.map +1 -0
  165. package/dist/react/primitives/PricingCard.js +125 -0
  166. package/dist/react/primitives/PricingCard.js.map +1 -0
  167. package/dist/react/primitives/PricingSection.d.ts +39 -0
  168. package/dist/react/primitives/PricingSection.d.ts.map +1 -0
  169. package/dist/react/primitives/PricingSection.js +24 -0
  170. package/dist/react/primitives/PricingSection.js.map +1 -0
  171. package/dist/react/primitives/ScheduledChangeBanner.d.ts +8 -0
  172. package/dist/react/primitives/ScheduledChangeBanner.d.ts.map +1 -0
  173. package/dist/react/primitives/ScheduledChangeBanner.js +13 -0
  174. package/dist/react/primitives/ScheduledChangeBanner.js.map +1 -0
  175. package/dist/react/primitives/SegmentControl.d.ts +11 -0
  176. package/dist/react/primitives/SegmentControl.d.ts.map +1 -0
  177. package/dist/react/primitives/SegmentControl.js +8 -0
  178. package/dist/react/primitives/SegmentControl.js.map +1 -0
  179. package/dist/react/primitives/SegmentGroup.d.ts +14 -0
  180. package/dist/react/primitives/SegmentGroup.d.ts.map +1 -0
  181. package/dist/react/primitives/SegmentGroup.js +11 -0
  182. package/dist/react/primitives/SegmentGroup.js.map +1 -0
  183. package/dist/react/primitives/TrialLimitBanner.d.ts +7 -0
  184. package/dist/react/primitives/TrialLimitBanner.d.ts.map +1 -0
  185. package/dist/react/primitives/TrialLimitBanner.js +14 -0
  186. package/dist/react/primitives/TrialLimitBanner.js.map +1 -0
  187. package/dist/react/shared.d.ts +28 -0
  188. package/dist/react/shared.d.ts.map +1 -0
  189. package/dist/react/shared.js +109 -0
  190. package/dist/react/shared.js.map +1 -0
  191. package/dist/react/widgets/BillingPortal.d.ts +9 -0
  192. package/dist/react/widgets/BillingPortal.d.ts.map +1 -0
  193. package/dist/react/widgets/BillingPortal.js +30 -0
  194. package/dist/react/widgets/BillingPortal.js.map +1 -0
  195. package/dist/react/widgets/ProductItem.d.ts +8 -0
  196. package/dist/react/widgets/ProductItem.d.ts.map +1 -0
  197. package/dist/react/widgets/ProductItem.js +14 -0
  198. package/dist/react/widgets/ProductItem.js.map +1 -0
  199. package/dist/react/widgets/ProductRoot.d.ts +16 -0
  200. package/dist/react/widgets/ProductRoot.d.ts.map +1 -0
  201. package/dist/react/widgets/ProductRoot.js +171 -0
  202. package/dist/react/widgets/ProductRoot.js.map +1 -0
  203. package/dist/react/widgets/SubscriptionItem.d.ts +27 -0
  204. package/dist/react/widgets/SubscriptionItem.d.ts.map +1 -0
  205. package/dist/react/widgets/SubscriptionItem.js +32 -0
  206. package/dist/react/widgets/SubscriptionItem.js.map +1 -0
  207. package/dist/react/widgets/SubscriptionRoot.d.ts +16 -0
  208. package/dist/react/widgets/SubscriptionRoot.d.ts.map +1 -0
  209. package/dist/react/widgets/SubscriptionRoot.js +405 -0
  210. package/dist/react/widgets/SubscriptionRoot.js.map +1 -0
  211. package/dist/react/widgets/index.d.ts +19 -0
  212. package/dist/react/widgets/index.d.ts.map +1 -0
  213. package/dist/react/widgets/index.js +16 -0
  214. package/dist/react/widgets/index.js.map +1 -0
  215. package/dist/react/widgets/productGroupContext.d.ts +6 -0
  216. package/dist/react/widgets/productGroupContext.d.ts.map +1 -0
  217. package/dist/react/widgets/productGroupContext.js +3 -0
  218. package/dist/react/widgets/productGroupContext.js.map +1 -0
  219. package/dist/react/widgets/subscriptionContext.d.ts +6 -0
  220. package/dist/react/widgets/subscriptionContext.d.ts.map +1 -0
  221. package/dist/react/widgets/subscriptionContext.js +3 -0
  222. package/dist/react/widgets/subscriptionContext.js.map +1 -0
  223. package/dist/react/widgets/types.d.ts +171 -0
  224. package/dist/react/widgets/types.d.ts.map +1 -0
  225. package/dist/react/widgets/types.js +2 -0
  226. package/dist/react/widgets/types.js.map +1 -0
  227. package/dist/svelte/index.d.ts +22 -0
  228. package/dist/svelte/index.d.ts.map +1 -0
  229. package/dist/svelte/index.js +20 -0
  230. package/dist/svelte/index.js.map +1 -0
  231. package/dist/svelte/primitives/BillingGate.svelte +28 -0
  232. package/dist/svelte/primitives/BillingToggle.svelte +27 -0
  233. package/dist/svelte/primitives/CheckoutButton.svelte +60 -0
  234. package/dist/svelte/primitives/CheckoutSuccessSummary.svelte +34 -0
  235. package/dist/svelte/primitives/CustomerPortalButton.svelte +60 -0
  236. package/dist/svelte/primitives/NumberInput.svelte +71 -0
  237. package/dist/svelte/primitives/OneTimeCheckoutButton.svelte +37 -0
  238. package/dist/svelte/primitives/OneTimePaymentStatusBadge.svelte +20 -0
  239. package/dist/svelte/primitives/PaymentWarningBanner.svelte +30 -0
  240. package/dist/svelte/primitives/PricingCard.svelte +356 -0
  241. package/dist/svelte/primitives/PricingSection.svelte +121 -0
  242. package/dist/svelte/primitives/ScheduledChangeBanner.svelte +46 -0
  243. package/dist/svelte/primitives/SegmentControl.svelte +38 -0
  244. package/dist/svelte/primitives/SegmentGroup.svelte +52 -0
  245. package/dist/svelte/primitives/TrialLimitBanner.svelte +32 -0
  246. package/dist/svelte/primitives/shared.d.ts +13 -0
  247. package/dist/svelte/primitives/shared.d.ts.map +1 -0
  248. package/dist/svelte/primitives/shared.js +87 -0
  249. package/dist/svelte/primitives/shared.js.map +1 -0
  250. package/dist/svelte/widgets/BillingPortal.svelte +55 -0
  251. package/dist/svelte/widgets/Product.svelte +35 -0
  252. package/dist/svelte/widgets/ProductRoot.svelte +428 -0
  253. package/dist/svelte/widgets/Subscription.svelte +52 -0
  254. package/dist/svelte/widgets/SubscriptionRoot.svelte +690 -0
  255. package/dist/svelte/widgets/index.d.ts +19 -0
  256. package/dist/svelte/widgets/index.d.ts.map +1 -0
  257. package/dist/svelte/widgets/index.js +16 -0
  258. package/dist/svelte/widgets/index.js.map +1 -0
  259. package/dist/svelte/widgets/productGroupContext.d.ts +6 -0
  260. package/dist/svelte/widgets/productGroupContext.d.ts.map +1 -0
  261. package/dist/svelte/widgets/productGroupContext.js +2 -0
  262. package/dist/svelte/widgets/productGroupContext.js.map +1 -0
  263. package/dist/svelte/widgets/subscriptionContext.d.ts +6 -0
  264. package/dist/svelte/widgets/subscriptionContext.d.ts.map +1 -0
  265. package/dist/svelte/widgets/subscriptionContext.js +2 -0
  266. package/dist/svelte/widgets/subscriptionContext.js.map +1 -0
  267. package/dist/svelte/widgets/types.d.ts +171 -0
  268. package/dist/svelte/widgets/types.d.ts.map +1 -0
  269. package/dist/svelte/widgets/types.js +2 -0
  270. package/dist/svelte/widgets/types.js.map +1 -0
  271. package/package.json +182 -0
  272. package/src/client/helpers.test.ts +139 -0
  273. package/src/client/helpers.ts +51 -0
  274. package/src/client/index.test.ts +1554 -0
  275. package/src/client/index.ts +1504 -0
  276. package/src/client/parsers.test.ts +1017 -0
  277. package/src/client/parsers.ts +182 -0
  278. package/src/client/polyfill.ts +2 -0
  279. package/src/component/_generated/api.ts +52 -0
  280. package/src/component/_generated/component.ts +619 -0
  281. package/src/component/_generated/dataModel.ts +60 -0
  282. package/src/component/_generated/server.ts +156 -0
  283. package/src/component/convex.config.ts +3 -0
  284. package/src/component/lib.test.ts +1359 -0
  285. package/src/component/lib.ts +726 -0
  286. package/src/component/schema.ts +112 -0
  287. package/src/component/util.test.ts +281 -0
  288. package/src/component/util.ts +228 -0
  289. package/src/core/catalog.test.ts +212 -0
  290. package/src/core/catalog.ts +119 -0
  291. package/src/core/index.ts +8 -0
  292. package/src/core/markdown.test.ts +43 -0
  293. package/src/core/markdown.ts +26 -0
  294. package/src/core/payments.test.ts +69 -0
  295. package/src/core/payments.ts +33 -0
  296. package/src/core/pendingCheckout.test.ts +44 -0
  297. package/src/core/pendingCheckout.ts +40 -0
  298. package/src/core/resolver.test.ts +283 -0
  299. package/src/core/resolver.ts +160 -0
  300. package/src/core/selectors.test.ts +119 -0
  301. package/src/core/selectors.ts +35 -0
  302. package/src/core/subscriptionUpdate.test.ts +164 -0
  303. package/src/core/subscriptionUpdate.ts +102 -0
  304. package/src/core/types.ts +220 -0
  305. package/src/design-system/README.md +40 -0
  306. package/src/design-system/base.css +27 -0
  307. package/src/design-system/colors/color-utils.ts +110 -0
  308. package/src/design-system/colors/config.ts +282 -0
  309. package/src/design-system/colors/index.ts +2 -0
  310. package/src/design-system/colors/utilities.css +2328 -0
  311. package/src/design-system/components/badges.css +65 -0
  312. package/src/design-system/components/buttons.css +256 -0
  313. package/src/design-system/components/dialog.css +218 -0
  314. package/src/design-system/components/icon-buttons.css +115 -0
  315. package/src/design-system/components/inputs.css +94 -0
  316. package/src/design-system/components/links.css +53 -0
  317. package/src/design-system/components/prose.css +67 -0
  318. package/src/design-system/components/segment-control.css +303 -0
  319. package/src/design-system/index.css +21 -0
  320. package/src/design-system/rounded/config.ts +91 -0
  321. package/src/design-system/rounded/index.ts +1 -0
  322. package/src/design-system/rounded/utilities.css +37 -0
  323. package/src/design-system/typography/config.ts +340 -0
  324. package/src/design-system/typography/index.ts +2 -0
  325. package/src/design-system/typography/tokens.ts +148 -0
  326. package/src/design-system/typography/utilities.css +728 -0
  327. package/src/library.css +20 -0
  328. package/src/react/hooks/useCheckoutSuccessParams.ts +7 -0
  329. package/src/react/index.tsx +47 -0
  330. package/src/react/primitives/BillingGate.tsx +26 -0
  331. package/src/react/primitives/BillingToggle.tsx +29 -0
  332. package/src/react/primitives/CheckoutButton.tsx +47 -0
  333. package/src/react/primitives/CheckoutSuccessSummary.tsx +36 -0
  334. package/src/react/primitives/CustomerPortalButton.tsx +50 -0
  335. package/src/react/primitives/NumberInput.tsx +83 -0
  336. package/src/react/primitives/OneTimeCheckoutButton.tsx +27 -0
  337. package/src/react/primitives/OneTimePaymentStatusBadge.tsx +18 -0
  338. package/src/react/primitives/PaymentWarningBanner.tsx +33 -0
  339. package/src/react/primitives/PricingCard.tsx +421 -0
  340. package/src/react/primitives/PricingSection.tsx +129 -0
  341. package/src/react/primitives/ScheduledChangeBanner.tsx +52 -0
  342. package/src/react/primitives/SegmentControl.tsx +32 -0
  343. package/src/react/primitives/SegmentGroup.tsx +53 -0
  344. package/src/react/primitives/TrialLimitBanner.tsx +32 -0
  345. package/src/react/shared.ts +138 -0
  346. package/src/react/widgets/BillingPortal.tsx +56 -0
  347. package/src/react/widgets/ProductItem.tsx +26 -0
  348. package/src/react/widgets/ProductRoot.tsx +441 -0
  349. package/src/react/widgets/SubscriptionItem.tsx +71 -0
  350. package/src/react/widgets/SubscriptionRoot.tsx +759 -0
  351. package/src/react/widgets/index.ts +36 -0
  352. package/src/react/widgets/productGroupContext.ts +10 -0
  353. package/src/react/widgets/subscriptionContext.ts +10 -0
  354. package/src/react/widgets/types.ts +179 -0
  355. package/src/svelte/index.ts +43 -0
  356. package/src/svelte/primitives/BillingGate.svelte +28 -0
  357. package/src/svelte/primitives/BillingToggle.svelte +27 -0
  358. package/src/svelte/primitives/CheckoutButton.svelte +60 -0
  359. package/src/svelte/primitives/CheckoutSuccessSummary.svelte +34 -0
  360. package/src/svelte/primitives/CustomerPortalButton.svelte +60 -0
  361. package/src/svelte/primitives/NumberInput.svelte +71 -0
  362. package/src/svelte/primitives/OneTimeCheckoutButton.svelte +37 -0
  363. package/src/svelte/primitives/OneTimePaymentStatusBadge.svelte +20 -0
  364. package/src/svelte/primitives/PaymentWarningBanner.svelte +30 -0
  365. package/src/svelte/primitives/PricingCard.svelte +356 -0
  366. package/src/svelte/primitives/PricingSection.svelte +121 -0
  367. package/src/svelte/primitives/ScheduledChangeBanner.svelte +46 -0
  368. package/src/svelte/primitives/SegmentControl.svelte +38 -0
  369. package/src/svelte/primitives/SegmentGroup.svelte +52 -0
  370. package/src/svelte/primitives/TrialLimitBanner.svelte +32 -0
  371. package/src/svelte/primitives/shared.ts +113 -0
  372. package/src/svelte/svelte.d.ts +6 -0
  373. package/src/svelte/widgets/BillingPortal.svelte +55 -0
  374. package/src/svelte/widgets/Product.svelte +35 -0
  375. package/src/svelte/widgets/ProductRoot.svelte +428 -0
  376. package/src/svelte/widgets/Subscription.svelte +52 -0
  377. package/src/svelte/widgets/SubscriptionRoot.svelte +690 -0
  378. package/src/svelte/widgets/index.ts +36 -0
  379. package/src/svelte/widgets/productGroupContext.ts +7 -0
  380. package/src/svelte/widgets/subscriptionContext.ts +7 -0
  381. package/src/svelte/widgets/types.ts +179 -0
  382. package/src/tailwind.css +6 -0
  383. package/src/test.ts +18 -0
@@ -0,0 +1,1005 @@
1
+ export declare const getCustomerByEntityId: import("convex/server").RegisteredQuery<"public", {
2
+ entityId: string;
3
+ }, Promise<{
4
+ _id: import("convex/values").GenericId<"customers">;
5
+ _creationTime: number;
6
+ mode?: string | undefined;
7
+ createdAt?: string | undefined;
8
+ updatedAt?: string | undefined;
9
+ email?: string | undefined;
10
+ name?: string | null | undefined;
11
+ country?: string | undefined;
12
+ metadata?: Record<string, any> | undefined;
13
+ id: string;
14
+ entityId: string;
15
+ } | Omit<{
16
+ _id: import("convex/values").GenericId<"customers">;
17
+ _creationTime: number;
18
+ mode?: string | undefined;
19
+ createdAt?: string | undefined;
20
+ updatedAt?: string | undefined;
21
+ email?: string | undefined;
22
+ name?: string | null | undefined;
23
+ country?: string | undefined;
24
+ metadata?: Record<string, any> | undefined;
25
+ id: string;
26
+ entityId: string;
27
+ }, "_creationTime" | "_id"> | null>>;
28
+ export declare const insertCustomer: import("convex/server").RegisteredMutation<"public", {
29
+ mode?: string | undefined;
30
+ createdAt?: string | undefined;
31
+ updatedAt?: string | undefined;
32
+ email?: string | undefined;
33
+ name?: string | null | undefined;
34
+ country?: string | undefined;
35
+ metadata?: Record<string, any> | undefined;
36
+ id: string;
37
+ entityId: string;
38
+ }, Promise<import("convex/values").GenericId<"customers">>>;
39
+ export declare const getSubscription: import("convex/server").RegisteredQuery<"public", {
40
+ id: string;
41
+ }, Promise<{
42
+ _id: import("convex/values").GenericId<"subscriptions">;
43
+ _creationTime: number;
44
+ mode?: string | undefined;
45
+ collectionMethod?: string | undefined;
46
+ priceId?: string | undefined;
47
+ discountId?: string | null | undefined;
48
+ canceledAt?: string | null | undefined;
49
+ endsAt?: string | null | undefined;
50
+ trialStart?: string | null | undefined;
51
+ trialEnd?: string | null | undefined;
52
+ seats?: number | null | undefined;
53
+ lastTransactionId?: string | null | undefined;
54
+ nextTransactionDate?: string | null | undefined;
55
+ id: string;
56
+ createdAt: string;
57
+ status: string;
58
+ metadata: Record<string, any>;
59
+ currency: string | null;
60
+ modifiedAt: string | null;
61
+ recurringInterval: string | null;
62
+ customerId: string;
63
+ productId: string;
64
+ amount: number | null;
65
+ currentPeriodStart: string;
66
+ currentPeriodEnd: string | null;
67
+ cancelAtPeriodEnd: boolean;
68
+ startedAt: string | null;
69
+ endedAt: string | null;
70
+ checkoutId: string | null;
71
+ } | Omit<{
72
+ _id: import("convex/values").GenericId<"subscriptions">;
73
+ _creationTime: number;
74
+ mode?: string | undefined;
75
+ collectionMethod?: string | undefined;
76
+ priceId?: string | undefined;
77
+ discountId?: string | null | undefined;
78
+ canceledAt?: string | null | undefined;
79
+ endsAt?: string | null | undefined;
80
+ trialStart?: string | null | undefined;
81
+ trialEnd?: string | null | undefined;
82
+ seats?: number | null | undefined;
83
+ lastTransactionId?: string | null | undefined;
84
+ nextTransactionDate?: string | null | undefined;
85
+ id: string;
86
+ createdAt: string;
87
+ status: string;
88
+ metadata: Record<string, any>;
89
+ currency: string | null;
90
+ modifiedAt: string | null;
91
+ recurringInterval: string | null;
92
+ customerId: string;
93
+ productId: string;
94
+ amount: number | null;
95
+ currentPeriodStart: string;
96
+ currentPeriodEnd: string | null;
97
+ cancelAtPeriodEnd: boolean;
98
+ startedAt: string | null;
99
+ endedAt: string | null;
100
+ checkoutId: string | null;
101
+ }, "_creationTime" | "_id"> | null>>;
102
+ export declare const getProduct: import("convex/server").RegisteredQuery<"public", {
103
+ id: string;
104
+ }, Promise<{
105
+ _id: import("convex/values").GenericId<"products">;
106
+ _creationTime: number;
107
+ mode?: string | undefined;
108
+ metadata?: Record<string, any> | undefined;
109
+ billingPeriod?: string | undefined;
110
+ taxMode?: string | undefined;
111
+ taxCategory?: string | undefined;
112
+ imageUrl?: string | undefined;
113
+ productUrl?: string | undefined;
114
+ defaultSuccessUrl?: string | null | undefined;
115
+ features?: {
116
+ id: string;
117
+ description: string;
118
+ }[] | undefined;
119
+ id: string;
120
+ createdAt: string;
121
+ status: string;
122
+ name: string;
123
+ description: string | null;
124
+ price: number;
125
+ currency: string;
126
+ billingType: string;
127
+ modifiedAt: string | null;
128
+ } | Omit<{
129
+ _id: import("convex/values").GenericId<"products">;
130
+ _creationTime: number;
131
+ mode?: string | undefined;
132
+ metadata?: Record<string, any> | undefined;
133
+ billingPeriod?: string | undefined;
134
+ taxMode?: string | undefined;
135
+ taxCategory?: string | undefined;
136
+ imageUrl?: string | undefined;
137
+ productUrl?: string | undefined;
138
+ defaultSuccessUrl?: string | null | undefined;
139
+ features?: {
140
+ id: string;
141
+ description: string;
142
+ }[] | undefined;
143
+ id: string;
144
+ createdAt: string;
145
+ status: string;
146
+ name: string;
147
+ description: string | null;
148
+ price: number;
149
+ currency: string;
150
+ billingType: string;
151
+ modifiedAt: string | null;
152
+ }, "_creationTime" | "_id"> | null>>;
153
+ /** For apps that have 0 or 1 active subscription per user. Excludes expired trials. */
154
+ export declare const getCurrentSubscription: import("convex/server").RegisteredQuery<"public", {
155
+ entityId: string;
156
+ }, Promise<{
157
+ product: {
158
+ _id: import("convex/values").GenericId<"products">;
159
+ _creationTime: number;
160
+ mode?: string | undefined;
161
+ metadata?: Record<string, any> | undefined;
162
+ billingPeriod?: string | undefined;
163
+ taxMode?: string | undefined;
164
+ taxCategory?: string | undefined;
165
+ imageUrl?: string | undefined;
166
+ productUrl?: string | undefined;
167
+ defaultSuccessUrl?: string | null | undefined;
168
+ features?: {
169
+ id: string;
170
+ description: string;
171
+ }[] | undefined;
172
+ id: string;
173
+ createdAt: string;
174
+ status: string;
175
+ name: string;
176
+ description: string | null;
177
+ price: number;
178
+ currency: string;
179
+ billingType: string;
180
+ modifiedAt: string | null;
181
+ } | Omit<{
182
+ _id: import("convex/values").GenericId<"products">;
183
+ _creationTime: number;
184
+ mode?: string | undefined;
185
+ metadata?: Record<string, any> | undefined;
186
+ billingPeriod?: string | undefined;
187
+ taxMode?: string | undefined;
188
+ taxCategory?: string | undefined;
189
+ imageUrl?: string | undefined;
190
+ productUrl?: string | undefined;
191
+ defaultSuccessUrl?: string | null | undefined;
192
+ features?: {
193
+ id: string;
194
+ description: string;
195
+ }[] | undefined;
196
+ id: string;
197
+ createdAt: string;
198
+ status: string;
199
+ name: string;
200
+ description: string | null;
201
+ price: number;
202
+ currency: string;
203
+ billingType: string;
204
+ modifiedAt: string | null;
205
+ }, "_creationTime" | "_id">;
206
+ _id: import("convex/values").GenericId<"subscriptions">;
207
+ _creationTime: number;
208
+ mode?: string | undefined;
209
+ collectionMethod?: string | undefined;
210
+ priceId?: string | undefined;
211
+ discountId?: string | null | undefined;
212
+ canceledAt?: string | null | undefined;
213
+ endsAt?: string | null | undefined;
214
+ trialStart?: string | null | undefined;
215
+ trialEnd?: string | null | undefined;
216
+ seats?: number | null | undefined;
217
+ lastTransactionId?: string | null | undefined;
218
+ nextTransactionDate?: string | null | undefined;
219
+ id: string;
220
+ createdAt: string;
221
+ status: string;
222
+ metadata: Record<string, any>;
223
+ currency: string | null;
224
+ modifiedAt: string | null;
225
+ recurringInterval: string | null;
226
+ customerId: string;
227
+ productId: string;
228
+ amount: number | null;
229
+ currentPeriodStart: string;
230
+ currentPeriodEnd: string | null;
231
+ cancelAtPeriodEnd: boolean;
232
+ startedAt: string | null;
233
+ endedAt: string | null;
234
+ checkoutId: string | null;
235
+ } | {
236
+ product: {
237
+ _id: import("convex/values").GenericId<"products">;
238
+ _creationTime: number;
239
+ mode?: string | undefined;
240
+ metadata?: Record<string, any> | undefined;
241
+ billingPeriod?: string | undefined;
242
+ taxMode?: string | undefined;
243
+ taxCategory?: string | undefined;
244
+ imageUrl?: string | undefined;
245
+ productUrl?: string | undefined;
246
+ defaultSuccessUrl?: string | null | undefined;
247
+ features?: {
248
+ id: string;
249
+ description: string;
250
+ }[] | undefined;
251
+ id: string;
252
+ createdAt: string;
253
+ status: string;
254
+ name: string;
255
+ description: string | null;
256
+ price: number;
257
+ currency: string;
258
+ billingType: string;
259
+ modifiedAt: string | null;
260
+ } | Omit<{
261
+ _id: import("convex/values").GenericId<"products">;
262
+ _creationTime: number;
263
+ mode?: string | undefined;
264
+ metadata?: Record<string, any> | undefined;
265
+ billingPeriod?: string | undefined;
266
+ taxMode?: string | undefined;
267
+ taxCategory?: string | undefined;
268
+ imageUrl?: string | undefined;
269
+ productUrl?: string | undefined;
270
+ defaultSuccessUrl?: string | null | undefined;
271
+ features?: {
272
+ id: string;
273
+ description: string;
274
+ }[] | undefined;
275
+ id: string;
276
+ createdAt: string;
277
+ status: string;
278
+ name: string;
279
+ description: string | null;
280
+ price: number;
281
+ currency: string;
282
+ billingType: string;
283
+ modifiedAt: string | null;
284
+ }, "_creationTime" | "_id">;
285
+ id: string;
286
+ mode?: string | undefined;
287
+ createdAt: string;
288
+ collectionMethod?: string | undefined;
289
+ status: string;
290
+ metadata: Record<string, any>;
291
+ currency: string | null;
292
+ modifiedAt: string | null;
293
+ recurringInterval: string | null;
294
+ customerId: string;
295
+ productId: string;
296
+ amount: number | null;
297
+ currentPeriodStart: string;
298
+ currentPeriodEnd: string | null;
299
+ cancelAtPeriodEnd: boolean;
300
+ startedAt: string | null;
301
+ endedAt: string | null;
302
+ priceId?: string | undefined;
303
+ checkoutId: string | null;
304
+ discountId?: string | null | undefined;
305
+ canceledAt?: string | null | undefined;
306
+ endsAt?: string | null | undefined;
307
+ trialStart?: string | null | undefined;
308
+ trialEnd?: string | null | undefined;
309
+ seats?: number | null | undefined;
310
+ lastTransactionId?: string | null | undefined;
311
+ nextTransactionDate?: string | null | undefined;
312
+ } | null>>;
313
+ /** List active subscriptions for a user, excluding ended and expired trials. */
314
+ export declare const listUserSubscriptions: import("convex/server").RegisteredQuery<"public", {
315
+ entityId: string;
316
+ }, Promise<({
317
+ product: {
318
+ _id: import("convex/values").GenericId<"products">;
319
+ _creationTime: number;
320
+ mode?: string | undefined;
321
+ metadata?: Record<string, any> | undefined;
322
+ billingPeriod?: string | undefined;
323
+ taxMode?: string | undefined;
324
+ taxCategory?: string | undefined;
325
+ imageUrl?: string | undefined;
326
+ productUrl?: string | undefined;
327
+ defaultSuccessUrl?: string | null | undefined;
328
+ features?: {
329
+ id: string;
330
+ description: string;
331
+ }[] | undefined;
332
+ id: string;
333
+ createdAt: string;
334
+ status: string;
335
+ name: string;
336
+ description: string | null;
337
+ price: number;
338
+ currency: string;
339
+ billingType: string;
340
+ modifiedAt: string | null;
341
+ } | Omit<{
342
+ _id: import("convex/values").GenericId<"products">;
343
+ _creationTime: number;
344
+ mode?: string | undefined;
345
+ metadata?: Record<string, any> | undefined;
346
+ billingPeriod?: string | undefined;
347
+ taxMode?: string | undefined;
348
+ taxCategory?: string | undefined;
349
+ imageUrl?: string | undefined;
350
+ productUrl?: string | undefined;
351
+ defaultSuccessUrl?: string | null | undefined;
352
+ features?: {
353
+ id: string;
354
+ description: string;
355
+ }[] | undefined;
356
+ id: string;
357
+ createdAt: string;
358
+ status: string;
359
+ name: string;
360
+ description: string | null;
361
+ price: number;
362
+ currency: string;
363
+ billingType: string;
364
+ modifiedAt: string | null;
365
+ }, "_creationTime" | "_id"> | null;
366
+ _id: import("convex/values").GenericId<"subscriptions">;
367
+ _creationTime: number;
368
+ mode?: string | undefined;
369
+ collectionMethod?: string | undefined;
370
+ priceId?: string | undefined;
371
+ discountId?: string | null | undefined;
372
+ canceledAt?: string | null | undefined;
373
+ endsAt?: string | null | undefined;
374
+ trialStart?: string | null | undefined;
375
+ trialEnd?: string | null | undefined;
376
+ seats?: number | null | undefined;
377
+ lastTransactionId?: string | null | undefined;
378
+ nextTransactionDate?: string | null | undefined;
379
+ id: string;
380
+ createdAt: string;
381
+ status: string;
382
+ metadata: Record<string, any>;
383
+ currency: string | null;
384
+ modifiedAt: string | null;
385
+ recurringInterval: string | null;
386
+ customerId: string;
387
+ productId: string;
388
+ amount: number | null;
389
+ currentPeriodStart: string;
390
+ currentPeriodEnd: string | null;
391
+ cancelAtPeriodEnd: boolean;
392
+ startedAt: string | null;
393
+ endedAt: string | null;
394
+ checkoutId: string | null;
395
+ } | {
396
+ product: {
397
+ _id: import("convex/values").GenericId<"products">;
398
+ _creationTime: number;
399
+ mode?: string | undefined;
400
+ metadata?: Record<string, any> | undefined;
401
+ billingPeriod?: string | undefined;
402
+ taxMode?: string | undefined;
403
+ taxCategory?: string | undefined;
404
+ imageUrl?: string | undefined;
405
+ productUrl?: string | undefined;
406
+ defaultSuccessUrl?: string | null | undefined;
407
+ features?: {
408
+ id: string;
409
+ description: string;
410
+ }[] | undefined;
411
+ id: string;
412
+ createdAt: string;
413
+ status: string;
414
+ name: string;
415
+ description: string | null;
416
+ price: number;
417
+ currency: string;
418
+ billingType: string;
419
+ modifiedAt: string | null;
420
+ } | Omit<{
421
+ _id: import("convex/values").GenericId<"products">;
422
+ _creationTime: number;
423
+ mode?: string | undefined;
424
+ metadata?: Record<string, any> | undefined;
425
+ billingPeriod?: string | undefined;
426
+ taxMode?: string | undefined;
427
+ taxCategory?: string | undefined;
428
+ imageUrl?: string | undefined;
429
+ productUrl?: string | undefined;
430
+ defaultSuccessUrl?: string | null | undefined;
431
+ features?: {
432
+ id: string;
433
+ description: string;
434
+ }[] | undefined;
435
+ id: string;
436
+ createdAt: string;
437
+ status: string;
438
+ name: string;
439
+ description: string | null;
440
+ price: number;
441
+ currency: string;
442
+ billingType: string;
443
+ modifiedAt: string | null;
444
+ }, "_creationTime" | "_id"> | null;
445
+ id: string;
446
+ mode?: string | undefined;
447
+ createdAt: string;
448
+ collectionMethod?: string | undefined;
449
+ status: string;
450
+ metadata: Record<string, any>;
451
+ currency: string | null;
452
+ modifiedAt: string | null;
453
+ recurringInterval: string | null;
454
+ customerId: string;
455
+ productId: string;
456
+ amount: number | null;
457
+ currentPeriodStart: string;
458
+ currentPeriodEnd: string | null;
459
+ cancelAtPeriodEnd: boolean;
460
+ startedAt: string | null;
461
+ endedAt: string | null;
462
+ priceId?: string | undefined;
463
+ checkoutId: string | null;
464
+ discountId?: string | null | undefined;
465
+ canceledAt?: string | null | undefined;
466
+ endsAt?: string | null | undefined;
467
+ trialStart?: string | null | undefined;
468
+ trialEnd?: string | null | undefined;
469
+ seats?: number | null | undefined;
470
+ lastTransactionId?: string | null | undefined;
471
+ nextTransactionDate?: string | null | undefined;
472
+ })[]>>;
473
+ /** Returns all subscriptions for a user, including ended and expired trials. */
474
+ export declare const listAllUserSubscriptions: import("convex/server").RegisteredQuery<"public", {
475
+ entityId: string;
476
+ }, Promise<({
477
+ product: {
478
+ _id: import("convex/values").GenericId<"products">;
479
+ _creationTime: number;
480
+ mode?: string | undefined;
481
+ metadata?: Record<string, any> | undefined;
482
+ billingPeriod?: string | undefined;
483
+ taxMode?: string | undefined;
484
+ taxCategory?: string | undefined;
485
+ imageUrl?: string | undefined;
486
+ productUrl?: string | undefined;
487
+ defaultSuccessUrl?: string | null | undefined;
488
+ features?: {
489
+ id: string;
490
+ description: string;
491
+ }[] | undefined;
492
+ id: string;
493
+ createdAt: string;
494
+ status: string;
495
+ name: string;
496
+ description: string | null;
497
+ price: number;
498
+ currency: string;
499
+ billingType: string;
500
+ modifiedAt: string | null;
501
+ } | Omit<{
502
+ _id: import("convex/values").GenericId<"products">;
503
+ _creationTime: number;
504
+ mode?: string | undefined;
505
+ metadata?: Record<string, any> | undefined;
506
+ billingPeriod?: string | undefined;
507
+ taxMode?: string | undefined;
508
+ taxCategory?: string | undefined;
509
+ imageUrl?: string | undefined;
510
+ productUrl?: string | undefined;
511
+ defaultSuccessUrl?: string | null | undefined;
512
+ features?: {
513
+ id: string;
514
+ description: string;
515
+ }[] | undefined;
516
+ id: string;
517
+ createdAt: string;
518
+ status: string;
519
+ name: string;
520
+ description: string | null;
521
+ price: number;
522
+ currency: string;
523
+ billingType: string;
524
+ modifiedAt: string | null;
525
+ }, "_creationTime" | "_id"> | null;
526
+ _id: import("convex/values").GenericId<"subscriptions">;
527
+ _creationTime: number;
528
+ mode?: string | undefined;
529
+ collectionMethod?: string | undefined;
530
+ priceId?: string | undefined;
531
+ discountId?: string | null | undefined;
532
+ canceledAt?: string | null | undefined;
533
+ endsAt?: string | null | undefined;
534
+ trialStart?: string | null | undefined;
535
+ trialEnd?: string | null | undefined;
536
+ seats?: number | null | undefined;
537
+ lastTransactionId?: string | null | undefined;
538
+ nextTransactionDate?: string | null | undefined;
539
+ id: string;
540
+ createdAt: string;
541
+ status: string;
542
+ metadata: Record<string, any>;
543
+ currency: string | null;
544
+ modifiedAt: string | null;
545
+ recurringInterval: string | null;
546
+ customerId: string;
547
+ productId: string;
548
+ amount: number | null;
549
+ currentPeriodStart: string;
550
+ currentPeriodEnd: string | null;
551
+ cancelAtPeriodEnd: boolean;
552
+ startedAt: string | null;
553
+ endedAt: string | null;
554
+ checkoutId: string | null;
555
+ } | {
556
+ product: {
557
+ _id: import("convex/values").GenericId<"products">;
558
+ _creationTime: number;
559
+ mode?: string | undefined;
560
+ metadata?: Record<string, any> | undefined;
561
+ billingPeriod?: string | undefined;
562
+ taxMode?: string | undefined;
563
+ taxCategory?: string | undefined;
564
+ imageUrl?: string | undefined;
565
+ productUrl?: string | undefined;
566
+ defaultSuccessUrl?: string | null | undefined;
567
+ features?: {
568
+ id: string;
569
+ description: string;
570
+ }[] | undefined;
571
+ id: string;
572
+ createdAt: string;
573
+ status: string;
574
+ name: string;
575
+ description: string | null;
576
+ price: number;
577
+ currency: string;
578
+ billingType: string;
579
+ modifiedAt: string | null;
580
+ } | Omit<{
581
+ _id: import("convex/values").GenericId<"products">;
582
+ _creationTime: number;
583
+ mode?: string | undefined;
584
+ metadata?: Record<string, any> | undefined;
585
+ billingPeriod?: string | undefined;
586
+ taxMode?: string | undefined;
587
+ taxCategory?: string | undefined;
588
+ imageUrl?: string | undefined;
589
+ productUrl?: string | undefined;
590
+ defaultSuccessUrl?: string | null | undefined;
591
+ features?: {
592
+ id: string;
593
+ description: string;
594
+ }[] | undefined;
595
+ id: string;
596
+ createdAt: string;
597
+ status: string;
598
+ name: string;
599
+ description: string | null;
600
+ price: number;
601
+ currency: string;
602
+ billingType: string;
603
+ modifiedAt: string | null;
604
+ }, "_creationTime" | "_id"> | null;
605
+ id: string;
606
+ mode?: string | undefined;
607
+ createdAt: string;
608
+ collectionMethod?: string | undefined;
609
+ status: string;
610
+ metadata: Record<string, any>;
611
+ currency: string | null;
612
+ modifiedAt: string | null;
613
+ recurringInterval: string | null;
614
+ customerId: string;
615
+ productId: string;
616
+ amount: number | null;
617
+ currentPeriodStart: string;
618
+ currentPeriodEnd: string | null;
619
+ cancelAtPeriodEnd: boolean;
620
+ startedAt: string | null;
621
+ endedAt: string | null;
622
+ priceId?: string | undefined;
623
+ checkoutId: string | null;
624
+ discountId?: string | null | undefined;
625
+ canceledAt?: string | null | undefined;
626
+ endsAt?: string | null | undefined;
627
+ trialStart?: string | null | undefined;
628
+ trialEnd?: string | null | undefined;
629
+ seats?: number | null | undefined;
630
+ lastTransactionId?: string | null | undefined;
631
+ nextTransactionDate?: string | null | undefined;
632
+ })[]>>;
633
+ export declare const listProducts: import("convex/server").RegisteredQuery<"public", {
634
+ includeArchived?: boolean | undefined;
635
+ }, Promise<({
636
+ _id: import("convex/values").GenericId<"products">;
637
+ _creationTime: number;
638
+ mode?: string | undefined;
639
+ metadata?: Record<string, any> | undefined;
640
+ billingPeriod?: string | undefined;
641
+ taxMode?: string | undefined;
642
+ taxCategory?: string | undefined;
643
+ imageUrl?: string | undefined;
644
+ productUrl?: string | undefined;
645
+ defaultSuccessUrl?: string | null | undefined;
646
+ features?: {
647
+ id: string;
648
+ description: string;
649
+ }[] | undefined;
650
+ id: string;
651
+ createdAt: string;
652
+ status: string;
653
+ name: string;
654
+ description: string | null;
655
+ price: number;
656
+ currency: string;
657
+ billingType: string;
658
+ modifiedAt: string | null;
659
+ } | Omit<{
660
+ _id: import("convex/values").GenericId<"products">;
661
+ _creationTime: number;
662
+ mode?: string | undefined;
663
+ metadata?: Record<string, any> | undefined;
664
+ billingPeriod?: string | undefined;
665
+ taxMode?: string | undefined;
666
+ taxCategory?: string | undefined;
667
+ imageUrl?: string | undefined;
668
+ productUrl?: string | undefined;
669
+ defaultSuccessUrl?: string | null | undefined;
670
+ features?: {
671
+ id: string;
672
+ description: string;
673
+ }[] | undefined;
674
+ id: string;
675
+ createdAt: string;
676
+ status: string;
677
+ name: string;
678
+ description: string | null;
679
+ price: number;
680
+ currency: string;
681
+ billingType: string;
682
+ modifiedAt: string | null;
683
+ }, "_creationTime" | "_id">)[]>>;
684
+ export declare const createSubscription: import("convex/server").RegisteredMutation<"public", {
685
+ subscription: {
686
+ mode?: string | undefined;
687
+ collectionMethod?: string | undefined;
688
+ priceId?: string | undefined;
689
+ discountId?: string | null | undefined;
690
+ canceledAt?: string | null | undefined;
691
+ endsAt?: string | null | undefined;
692
+ trialStart?: string | null | undefined;
693
+ trialEnd?: string | null | undefined;
694
+ seats?: number | null | undefined;
695
+ lastTransactionId?: string | null | undefined;
696
+ nextTransactionDate?: string | null | undefined;
697
+ id: string;
698
+ createdAt: string;
699
+ status: string;
700
+ metadata: Record<string, any>;
701
+ currency: string | null;
702
+ modifiedAt: string | null;
703
+ recurringInterval: string | null;
704
+ customerId: string;
705
+ productId: string;
706
+ amount: number | null;
707
+ currentPeriodStart: string;
708
+ currentPeriodEnd: string | null;
709
+ cancelAtPeriodEnd: boolean;
710
+ startedAt: string | null;
711
+ endedAt: string | null;
712
+ checkoutId: string | null;
713
+ };
714
+ }, Promise<void>>;
715
+ export declare const updateSubscription: import("convex/server").RegisteredMutation<"public", {
716
+ subscription: {
717
+ mode?: string | undefined;
718
+ collectionMethod?: string | undefined;
719
+ priceId?: string | undefined;
720
+ discountId?: string | null | undefined;
721
+ canceledAt?: string | null | undefined;
722
+ endsAt?: string | null | undefined;
723
+ trialStart?: string | null | undefined;
724
+ trialEnd?: string | null | undefined;
725
+ seats?: number | null | undefined;
726
+ lastTransactionId?: string | null | undefined;
727
+ nextTransactionDate?: string | null | undefined;
728
+ id: string;
729
+ createdAt: string;
730
+ status: string;
731
+ metadata: Record<string, any>;
732
+ currency: string | null;
733
+ modifiedAt: string | null;
734
+ recurringInterval: string | null;
735
+ customerId: string;
736
+ productId: string;
737
+ amount: number | null;
738
+ currentPeriodStart: string;
739
+ currentPeriodEnd: string | null;
740
+ cancelAtPeriodEnd: boolean;
741
+ startedAt: string | null;
742
+ endedAt: string | null;
743
+ checkoutId: string | null;
744
+ };
745
+ }, Promise<void>>;
746
+ export declare const createProduct: import("convex/server").RegisteredMutation<"public", {
747
+ product: {
748
+ mode?: string | undefined;
749
+ metadata?: Record<string, any> | undefined;
750
+ billingPeriod?: string | undefined;
751
+ taxMode?: string | undefined;
752
+ taxCategory?: string | undefined;
753
+ imageUrl?: string | undefined;
754
+ productUrl?: string | undefined;
755
+ defaultSuccessUrl?: string | null | undefined;
756
+ features?: {
757
+ id: string;
758
+ description: string;
759
+ }[] | undefined;
760
+ id: string;
761
+ createdAt: string;
762
+ status: string;
763
+ name: string;
764
+ description: string | null;
765
+ price: number;
766
+ currency: string;
767
+ billingType: string;
768
+ modifiedAt: string | null;
769
+ };
770
+ }, Promise<void>>;
771
+ export declare const updateProduct: import("convex/server").RegisteredMutation<"public", {
772
+ product: {
773
+ mode?: string | undefined;
774
+ metadata?: Record<string, any> | undefined;
775
+ billingPeriod?: string | undefined;
776
+ taxMode?: string | undefined;
777
+ taxCategory?: string | undefined;
778
+ imageUrl?: string | undefined;
779
+ productUrl?: string | undefined;
780
+ defaultSuccessUrl?: string | null | undefined;
781
+ features?: {
782
+ id: string;
783
+ description: string;
784
+ }[] | undefined;
785
+ id: string;
786
+ createdAt: string;
787
+ status: string;
788
+ name: string;
789
+ description: string | null;
790
+ price: number;
791
+ currency: string;
792
+ billingType: string;
793
+ modifiedAt: string | null;
794
+ };
795
+ }, Promise<void>>;
796
+ export declare const createOrder: import("convex/server").RegisteredMutation<"public", {
797
+ order: {
798
+ mode?: string | undefined;
799
+ metadata?: Record<string, any> | undefined;
800
+ checkoutId?: string | null | undefined;
801
+ discountId?: string | null | undefined;
802
+ subTotal?: number | undefined;
803
+ taxAmount?: number | undefined;
804
+ discountAmount?: number | undefined;
805
+ amountDue?: number | undefined;
806
+ amountPaid?: number | undefined;
807
+ transactionId?: string | null | undefined;
808
+ affiliate?: string | null | undefined;
809
+ id: string;
810
+ createdAt: string;
811
+ updatedAt: string;
812
+ status: string;
813
+ type: string;
814
+ currency: string;
815
+ customerId: string;
816
+ productId: string;
817
+ amount: number;
818
+ };
819
+ }, Promise<void>>;
820
+ /** List paid one-time orders for a user. */
821
+ export declare const listUserOrders: import("convex/server").RegisteredQuery<"public", {
822
+ entityId: string;
823
+ }, Promise<({
824
+ _id: import("convex/values").GenericId<"orders">;
825
+ _creationTime: number;
826
+ mode?: string | undefined;
827
+ metadata?: Record<string, any> | undefined;
828
+ checkoutId?: string | null | undefined;
829
+ discountId?: string | null | undefined;
830
+ subTotal?: number | undefined;
831
+ taxAmount?: number | undefined;
832
+ discountAmount?: number | undefined;
833
+ amountDue?: number | undefined;
834
+ amountPaid?: number | undefined;
835
+ transactionId?: string | null | undefined;
836
+ affiliate?: string | null | undefined;
837
+ id: string;
838
+ createdAt: string;
839
+ updatedAt: string;
840
+ status: string;
841
+ type: string;
842
+ currency: string;
843
+ customerId: string;
844
+ productId: string;
845
+ amount: number;
846
+ } | Omit<{
847
+ _id: import("convex/values").GenericId<"orders">;
848
+ _creationTime: number;
849
+ mode?: string | undefined;
850
+ metadata?: Record<string, any> | undefined;
851
+ checkoutId?: string | null | undefined;
852
+ discountId?: string | null | undefined;
853
+ subTotal?: number | undefined;
854
+ taxAmount?: number | undefined;
855
+ discountAmount?: number | undefined;
856
+ amountDue?: number | undefined;
857
+ amountPaid?: number | undefined;
858
+ transactionId?: string | null | undefined;
859
+ affiliate?: string | null | undefined;
860
+ id: string;
861
+ createdAt: string;
862
+ updatedAt: string;
863
+ status: string;
864
+ type: string;
865
+ currency: string;
866
+ customerId: string;
867
+ productId: string;
868
+ amount: number;
869
+ }, "_creationTime" | "_id">)[]>>;
870
+ export declare const listCustomerSubscriptions: import("convex/server").RegisteredQuery<"public", {
871
+ customerId: string;
872
+ }, Promise<({
873
+ _id: import("convex/values").GenericId<"subscriptions">;
874
+ _creationTime: number;
875
+ mode?: string | undefined;
876
+ collectionMethod?: string | undefined;
877
+ priceId?: string | undefined;
878
+ discountId?: string | null | undefined;
879
+ canceledAt?: string | null | undefined;
880
+ endsAt?: string | null | undefined;
881
+ trialStart?: string | null | undefined;
882
+ trialEnd?: string | null | undefined;
883
+ seats?: number | null | undefined;
884
+ lastTransactionId?: string | null | undefined;
885
+ nextTransactionDate?: string | null | undefined;
886
+ id: string;
887
+ createdAt: string;
888
+ status: string;
889
+ metadata: Record<string, any>;
890
+ currency: string | null;
891
+ modifiedAt: string | null;
892
+ recurringInterval: string | null;
893
+ customerId: string;
894
+ productId: string;
895
+ amount: number | null;
896
+ currentPeriodStart: string;
897
+ currentPeriodEnd: string | null;
898
+ cancelAtPeriodEnd: boolean;
899
+ startedAt: string | null;
900
+ endedAt: string | null;
901
+ checkoutId: string | null;
902
+ } | Omit<{
903
+ _id: import("convex/values").GenericId<"subscriptions">;
904
+ _creationTime: number;
905
+ mode?: string | undefined;
906
+ collectionMethod?: string | undefined;
907
+ priceId?: string | undefined;
908
+ discountId?: string | null | undefined;
909
+ canceledAt?: string | null | undefined;
910
+ endsAt?: string | null | undefined;
911
+ trialStart?: string | null | undefined;
912
+ trialEnd?: string | null | undefined;
913
+ seats?: number | null | undefined;
914
+ lastTransactionId?: string | null | undefined;
915
+ nextTransactionDate?: string | null | undefined;
916
+ id: string;
917
+ createdAt: string;
918
+ status: string;
919
+ metadata: Record<string, any>;
920
+ currency: string | null;
921
+ modifiedAt: string | null;
922
+ recurringInterval: string | null;
923
+ customerId: string;
924
+ productId: string;
925
+ amount: number | null;
926
+ currentPeriodStart: string;
927
+ currentPeriodEnd: string | null;
928
+ cancelAtPeriodEnd: boolean;
929
+ startedAt: string | null;
930
+ endedAt: string | null;
931
+ checkoutId: string | null;
932
+ }, "_creationTime" | "_id">)[]>>;
933
+ export declare const syncProducts: import("convex/server").RegisteredAction<"public", {
934
+ serverIdx?: number | undefined;
935
+ serverURL?: string | undefined;
936
+ apiKey: string;
937
+ }, Promise<void>>;
938
+ export declare const updateProducts: import("convex/server").RegisteredMutation<"public", {
939
+ products: {
940
+ mode?: string | undefined;
941
+ metadata?: Record<string, any> | undefined;
942
+ billingPeriod?: string | undefined;
943
+ taxMode?: string | undefined;
944
+ taxCategory?: string | undefined;
945
+ imageUrl?: string | undefined;
946
+ productUrl?: string | undefined;
947
+ defaultSuccessUrl?: string | null | undefined;
948
+ features?: {
949
+ id: string;
950
+ description: string;
951
+ }[] | undefined;
952
+ id: string;
953
+ createdAt: string;
954
+ status: string;
955
+ name: string;
956
+ description: string | null;
957
+ price: number;
958
+ currency: string;
959
+ billingType: string;
960
+ modifiedAt: string | null;
961
+ }[];
962
+ }, Promise<void>>;
963
+ /** Lightweight patch for optimistic UI updates (seats, productId, status).
964
+ * Tracks which fields were optimistically changed via `_optimisticPendingAt`
965
+ * and `_optimisticFields` in the subscription's metadata so that incoming
966
+ * webhooks with stale intermediate values don't overwrite the optimistic state. */
967
+ export declare const patchSubscription: import("convex/server").RegisteredMutation<"public", {
968
+ status?: string | undefined;
969
+ productId?: string | undefined;
970
+ cancelAtPeriodEnd?: boolean | undefined;
971
+ seats?: number | null | undefined;
972
+ clearOptimistic?: boolean | undefined;
973
+ subscriptionId: string;
974
+ }, Promise<void>>;
975
+ /** Action that calls Creem API and reverts on error. Scheduled by mutations.
976
+ * Public (not internal) so it's accessible via ComponentApi for scheduling from app-level mutations.
977
+ * Secured by requiring apiKey argument (same pattern as syncProducts). */
978
+ export declare const executeSubscriptionUpdate: import("convex/server").RegisteredAction<"public", {
979
+ units?: number | undefined;
980
+ productId?: string | undefined;
981
+ serverIdx?: number | undefined;
982
+ serverURL?: string | undefined;
983
+ previousProductId?: string | undefined;
984
+ previousSeats?: number | null | undefined;
985
+ updateBehavior?: string | undefined;
986
+ apiKey: string;
987
+ subscriptionId: string;
988
+ }, Promise<void>>;
989
+ /** Action that calls Creem API for cancel/resume/pause and reverts on error.
990
+ * Scheduled by the corresponding mutations in api(). */
991
+ export declare const executeSubscriptionLifecycle: import("convex/server").RegisteredAction<"public", {
992
+ cancelMode?: string | undefined;
993
+ previousCancelAtPeriodEnd?: boolean | undefined;
994
+ previousStatus?: string | undefined;
995
+ serverIdx?: number | undefined;
996
+ serverURL?: string | undefined;
997
+ apiKey: string;
998
+ operation: "cancel" | "resume" | "pause";
999
+ subscriptionId: string;
1000
+ }, Promise<void>>;
1001
+ export declare const omitSystemFields: <T extends {
1002
+ _id: string;
1003
+ _creationTime: number;
1004
+ } | null | undefined>(doc: T) => T | Omit<NonNullable<T>, "_creationTime" | "_id">;
1005
+ //# sourceMappingURL=lib.d.ts.map