@carlonicora/nextjs-jsonapi 1.15.0 → 1.16.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 (271) hide show
  1. package/dist/{ApiResponseInterface-B4QdWh-y.d.mts → ApiResponseInterface-BvWIeLkq.d.ts} +2 -1
  2. package/dist/{ApiResponseInterface-QLDnxLA9.d.ts → ApiResponseInterface-CAbw0sv7.d.mts} +2 -1
  3. package/dist/{BlockNoteEditor-ITJLAOXC.mjs → BlockNoteEditor-HFX7Z5BQ.mjs} +5 -5
  4. package/dist/{BlockNoteEditor-FGXYUAWI.js → BlockNoteEditor-MBFDWP7X.js} +15 -15
  5. package/dist/{BlockNoteEditor-FGXYUAWI.js.map → BlockNoteEditor-MBFDWP7X.js.map} +1 -1
  6. package/dist/JsonApiRequest-45CLE65I.js +24 -0
  7. package/dist/{JsonApiRequest-FXZCYIER.js.map → JsonApiRequest-45CLE65I.js.map} +1 -1
  8. package/dist/{JsonApiRequest-HFWXMKMA.mjs → JsonApiRequest-6IPS3DZJ.mjs} +2 -2
  9. package/dist/{chunk-C6QXZGL7.js → chunk-2AZLCF6D.js} +1617 -158
  10. package/dist/chunk-2AZLCF6D.js.map +1 -0
  11. package/dist/{chunk-WAFOKMKT.mjs → chunk-5RAUCUAA.mjs} +3722 -396
  12. package/dist/chunk-5RAUCUAA.mjs.map +1 -0
  13. package/dist/{chunk-TGBXBUWM.mjs → chunk-BCKYJQ3K.mjs} +8 -1
  14. package/dist/chunk-BCKYJQ3K.mjs.map +1 -0
  15. package/dist/{chunk-JGVXZS7M.mjs → chunk-BCQSE3EU.mjs} +1588 -129
  16. package/dist/chunk-BCQSE3EU.mjs.map +1 -0
  17. package/dist/{chunk-FPZPD4JI.js → chunk-GPGJNTHP.js} +17 -10
  18. package/dist/chunk-GPGJNTHP.js.map +1 -0
  19. package/dist/{chunk-PK5DRSUD.js → chunk-ONB2DAIV.js} +4090 -764
  20. package/dist/chunk-ONB2DAIV.js.map +1 -0
  21. package/dist/{chunk-SJIVGCNM.mjs → chunk-POKIJ56Q.mjs} +7 -2
  22. package/dist/chunk-POKIJ56Q.mjs.map +1 -0
  23. package/dist/{chunk-6YD42BP6.js → chunk-R5QSSISB.js} +14 -9
  24. package/dist/chunk-R5QSSISB.js.map +1 -0
  25. package/dist/client/index.d.mts +5 -5
  26. package/dist/client/index.d.ts +5 -5
  27. package/dist/client/index.js +7 -5
  28. package/dist/client/index.js.map +1 -1
  29. package/dist/client/index.mjs +6 -4
  30. package/dist/components/index.d.mts +253 -9
  31. package/dist/components/index.d.ts +253 -9
  32. package/dist/components/index.js +83 -5
  33. package/dist/components/index.js.map +1 -1
  34. package/dist/components/index.mjs +82 -4
  35. package/dist/{config-eceYM5kN.d.ts → config-CWsTwnsK.d.mts} +7 -2
  36. package/dist/{config-C5tGGrYf.d.mts → config-DEaUbBqR.d.ts} +7 -2
  37. package/dist/{content.interface-TB2MfJGs.d.ts → content.interface-D_4b4RQt.d.ts} +1 -1
  38. package/dist/{content.interface-CxBBC7ec.d.mts → content.interface-Dk4UZcJM.d.mts} +1 -1
  39. package/dist/contexts/index.d.mts +2 -2
  40. package/dist/contexts/index.d.ts +2 -2
  41. package/dist/contexts/index.js +5 -5
  42. package/dist/contexts/index.mjs +4 -4
  43. package/dist/core/index.d.mts +521 -18
  44. package/dist/core/index.d.ts +521 -18
  45. package/dist/core/index.js +53 -3
  46. package/dist/core/index.js.map +1 -1
  47. package/dist/core/index.mjs +52 -2
  48. package/dist/index.d.mts +7 -7
  49. package/dist/index.d.ts +7 -7
  50. package/dist/index.js +56 -4
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.mjs +55 -3
  53. package/dist/{notification.interface-lG6UpTpt.d.mts → notification.interface-BllkURRm.d.mts} +1 -2
  54. package/dist/{notification.interface-lG6UpTpt.d.ts → notification.interface-BllkURRm.d.ts} +1 -2
  55. package/dist/{s3.service-DP_hsssD.d.mts → s3.service-BEfGqho0.d.ts} +20 -2
  56. package/dist/{s3.service-Dq-PTUNa.d.ts → s3.service-DIQRYe93.d.mts} +20 -2
  57. package/dist/scripts/generate-web-module/generator.d.ts.map +1 -1
  58. package/dist/scripts/generate-web-module/generator.js +66 -0
  59. package/dist/scripts/generate-web-module/generator.js.map +1 -1
  60. package/dist/scripts/generate-web-module/templates/index.d.ts +8 -0
  61. package/dist/scripts/generate-web-module/templates/index.d.ts.map +1 -1
  62. package/dist/scripts/generate-web-module/templates/index.js +18 -1
  63. package/dist/scripts/generate-web-module/templates/index.js.map +1 -1
  64. package/dist/scripts/generate-web-module/templates/project/bootstrapper.template.d.ts +7 -0
  65. package/dist/scripts/generate-web-module/templates/project/bootstrapper.template.d.ts.map +1 -0
  66. package/dist/scripts/generate-web-module/templates/project/bootstrapper.template.js +141 -0
  67. package/dist/scripts/generate-web-module/templates/project/bootstrapper.template.js.map +1 -0
  68. package/dist/scripts/generate-web-module/templates/project/env.template.d.ts +7 -0
  69. package/dist/scripts/generate-web-module/templates/project/env.template.d.ts.map +1 -0
  70. package/dist/scripts/generate-web-module/templates/project/env.template.js +110 -0
  71. package/dist/scripts/generate-web-module/templates/project/env.template.js.map +1 -0
  72. package/dist/scripts/generate-web-module/templates/project/main-layout.template.d.ts +7 -0
  73. package/dist/scripts/generate-web-module/templates/project/main-layout.template.d.ts.map +1 -0
  74. package/dist/scripts/generate-web-module/templates/project/main-layout.template.js +101 -0
  75. package/dist/scripts/generate-web-module/templates/project/main-layout.template.js.map +1 -0
  76. package/dist/scripts/generate-web-module/templates/project/middleware-env.template.d.ts +7 -0
  77. package/dist/scripts/generate-web-module/templates/project/middleware-env.template.d.ts.map +1 -0
  78. package/dist/scripts/generate-web-module/templates/project/middleware-env.template.js +66 -0
  79. package/dist/scripts/generate-web-module/templates/project/middleware-env.template.js.map +1 -0
  80. package/dist/scripts/generate-web-module/templates/project/settings-container.template.d.ts +7 -0
  81. package/dist/scripts/generate-web-module/templates/project/settings-container.template.d.ts.map +1 -0
  82. package/dist/scripts/generate-web-module/templates/project/settings-container.template.js +257 -0
  83. package/dist/scripts/generate-web-module/templates/project/settings-container.template.js.map +1 -0
  84. package/dist/scripts/generate-web-module/templates/project/settings-context.template.d.ts +7 -0
  85. package/dist/scripts/generate-web-module/templates/project/settings-context.template.d.ts.map +1 -0
  86. package/dist/scripts/generate-web-module/templates/project/settings-context.template.js +124 -0
  87. package/dist/scripts/generate-web-module/templates/project/settings-context.template.js.map +1 -0
  88. package/dist/scripts/generate-web-module/templates/project/settings-module-page.template.d.ts +7 -0
  89. package/dist/scripts/generate-web-module/templates/project/settings-module-page.template.d.ts.map +1 -0
  90. package/dist/scripts/generate-web-module/templates/project/settings-module-page.template.js +78 -0
  91. package/dist/scripts/generate-web-module/templates/project/settings-module-page.template.js.map +1 -0
  92. package/dist/scripts/generate-web-module/templates/project/settings-page.template.d.ts +7 -0
  93. package/dist/scripts/generate-web-module/templates/project/settings-page.template.d.ts.map +1 -0
  94. package/dist/scripts/generate-web-module/templates/project/settings-page.template.js +75 -0
  95. package/dist/scripts/generate-web-module/templates/project/settings-page.template.js.map +1 -0
  96. package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +1 -1
  97. package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
  98. package/dist/server/index.d.mts +4 -4
  99. package/dist/server/index.d.ts +4 -4
  100. package/dist/server/index.js +12 -12
  101. package/dist/server/index.mjs +2 -2
  102. package/dist/stripe-subscription.interface-C63L6hVg.d.mts +226 -0
  103. package/dist/stripe-subscription.interface-CUvNDvw5.d.ts +226 -0
  104. package/dist/{useSocket-Bua6MwLi.d.mts → useSocket-BpenBR2z.d.mts} +1 -1
  105. package/dist/{useSocket-D5dhUp4m.d.ts → useSocket-D-QYA0Sr.d.ts} +1 -1
  106. package/package.json +9 -1
  107. package/scripts/generate-web-module/generator.ts +83 -0
  108. package/scripts/generate-web-module/templates/index.ts +10 -0
  109. package/scripts/generate-web-module/templates/project/bootstrapper.template.ts +108 -0
  110. package/scripts/generate-web-module/templates/project/env.template.ts +77 -0
  111. package/scripts/generate-web-module/templates/project/main-layout.template.tsx +68 -0
  112. package/scripts/generate-web-module/templates/project/middleware-env.template.ts +33 -0
  113. package/scripts/generate-web-module/templates/project/settings-container.template.tsx +224 -0
  114. package/scripts/generate-web-module/templates/project/settings-context.template.tsx +91 -0
  115. package/scripts/generate-web-module/templates/project/settings-module-page.template.tsx +45 -0
  116. package/scripts/generate-web-module/templates/project/settings-page.template.tsx +42 -0
  117. package/scripts/generate-web-module/types/template-data.interface.ts +1 -1
  118. package/src/client/config.ts +9 -0
  119. package/src/components/index.ts +7 -0
  120. package/src/core/abstracts/AbstractService.ts +104 -0
  121. package/src/core/endpoint/EndpointCreator.ts +7 -4
  122. package/src/core/index.ts +12 -4
  123. package/src/core/interfaces/ApiResponseInterface.ts +1 -0
  124. package/src/core/registry/ModuleRegistry.ts +11 -2
  125. package/src/core/utils/translateResponse.ts +17 -0
  126. package/src/features/billing/components/cards/BillingUsageSummaryCard.tsx +97 -0
  127. package/src/features/billing/components/cards/CustomerInfoCard.tsx +112 -0
  128. package/src/features/billing/components/cards/InvoicesSummaryCard.tsx +114 -0
  129. package/src/features/billing/components/cards/PaymentMethodSummaryCard.tsx +119 -0
  130. package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +146 -0
  131. package/src/features/billing/components/cards/index.ts +5 -0
  132. package/src/features/billing/components/containers/BillingDashboardContainer.tsx +427 -0
  133. package/src/features/billing/components/containers/index.ts +1 -0
  134. package/src/features/billing/components/index.ts +6 -0
  135. package/src/features/billing/components/modals/BillingDetailModal.tsx +36 -0
  136. package/src/features/billing/components/modals/index.ts +1 -0
  137. package/src/features/billing/components/providers/StripeProvider.tsx +48 -0
  138. package/src/features/billing/components/providers/index.ts +1 -0
  139. package/src/features/billing/components/utils/currency.ts +49 -0
  140. package/src/features/billing/components/utils/date.ts +21 -0
  141. package/src/features/billing/components/utils/index.ts +2 -0
  142. package/src/features/billing/components/widgets/BillingAlertBanner.tsx +63 -0
  143. package/src/features/billing/components/widgets/index.ts +1 -0
  144. package/src/features/billing/data/Billing.ts +17 -0
  145. package/src/features/billing/data/billing.service.ts +58 -0
  146. package/src/features/billing/data/index.ts +5 -0
  147. package/src/features/billing/index.ts +3 -0
  148. package/src/features/billing/modules/billing.module.ts +9 -0
  149. package/src/features/billing/modules/index.ts +1 -0
  150. package/src/features/billing/stripe-customer/components/containers/PaymentMethodsContainer.tsx +79 -0
  151. package/src/features/billing/stripe-customer/components/containers/index.ts +1 -0
  152. package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +151 -0
  153. package/src/features/billing/stripe-customer/components/details/index.ts +1 -0
  154. package/src/features/billing/stripe-customer/components/forms/PaymentMethodEditor.tsx +186 -0
  155. package/src/features/billing/stripe-customer/components/forms/index.ts +1 -0
  156. package/src/features/billing/stripe-customer/components/index.ts +4 -0
  157. package/src/features/billing/stripe-customer/components/lists/PaymentMethodsList.tsx +19 -0
  158. package/src/features/billing/stripe-customer/components/lists/index.ts +1 -0
  159. package/src/features/billing/stripe-customer/data/index.ts +5 -0
  160. package/src/features/billing/stripe-customer/data/payment-method.interface.ts +27 -0
  161. package/src/features/billing/stripe-customer/data/payment-method.ts +119 -0
  162. package/src/features/billing/stripe-customer/data/stripe-customer.interface.ts +16 -0
  163. package/src/features/billing/stripe-customer/data/stripe-customer.service.ts +128 -0
  164. package/src/features/billing/stripe-customer/data/stripe-customer.ts +71 -0
  165. package/src/features/billing/stripe-customer/index.ts +3 -0
  166. package/src/features/billing/stripe-customer/stripe-customer.module.ts +9 -0
  167. package/src/features/billing/stripe-customer/stripe-payment-method.module.ts +9 -0
  168. package/src/features/billing/stripe-invoice/components/containers/InvoicesContainer.tsx +66 -0
  169. package/src/features/billing/stripe-invoice/components/containers/index.ts +1 -0
  170. package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +172 -0
  171. package/src/features/billing/stripe-invoice/components/details/index.ts +1 -0
  172. package/src/features/billing/stripe-invoice/components/index.ts +4 -0
  173. package/src/features/billing/stripe-invoice/components/lists/InvoicesList.tsx +84 -0
  174. package/src/features/billing/stripe-invoice/components/lists/index.ts +1 -0
  175. package/src/features/billing/stripe-invoice/components/widgets/InvoiceStatusBadge.tsx +41 -0
  176. package/src/features/billing/stripe-invoice/components/widgets/index.ts +1 -0
  177. package/src/features/billing/stripe-invoice/data/index.ts +3 -0
  178. package/src/features/billing/stripe-invoice/data/stripe-invoice.interface.ts +65 -0
  179. package/src/features/billing/stripe-invoice/data/stripe-invoice.service.ts +64 -0
  180. package/src/features/billing/stripe-invoice/data/stripe-invoice.ts +177 -0
  181. package/src/features/billing/stripe-invoice/index.ts +2 -0
  182. package/src/features/billing/stripe-invoice/stripe-invoice.module.ts +9 -0
  183. package/src/features/billing/stripe-price/components/forms/PriceEditor.tsx +304 -0
  184. package/src/features/billing/stripe-price/components/forms/index.ts +1 -0
  185. package/src/features/billing/stripe-price/components/index.ts +2 -0
  186. package/src/features/billing/stripe-price/components/lists/PricesList.tsx +283 -0
  187. package/src/features/billing/stripe-price/components/lists/index.ts +1 -0
  188. package/src/features/billing/stripe-price/data/index.ts +3 -0
  189. package/src/features/billing/stripe-price/data/stripe-price.interface.ts +48 -0
  190. package/src/features/billing/stripe-price/data/stripe-price.service.ts +123 -0
  191. package/src/features/billing/stripe-price/data/stripe-price.ts +156 -0
  192. package/src/features/billing/stripe-price/index.ts +2 -0
  193. package/src/features/billing/stripe-price/stripe-price.module.ts +9 -0
  194. package/src/features/billing/stripe-product/components/containers/ProductsAdminContainer.tsx +86 -0
  195. package/src/features/billing/stripe-product/components/containers/index.ts +1 -0
  196. package/src/features/billing/stripe-product/components/forms/ProductEditor.tsx +100 -0
  197. package/src/features/billing/stripe-product/components/forms/index.ts +1 -0
  198. package/src/features/billing/stripe-product/components/index.ts +3 -0
  199. package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +206 -0
  200. package/src/features/billing/stripe-product/components/lists/index.ts +1 -0
  201. package/src/features/billing/stripe-product/data/index.ts +3 -0
  202. package/src/features/billing/stripe-product/data/stripe-product.interface.ts +18 -0
  203. package/src/features/billing/stripe-product/data/stripe-product.service.ts +112 -0
  204. package/src/features/billing/stripe-product/data/stripe-product.ts +74 -0
  205. package/src/features/billing/stripe-product/index.ts +2 -0
  206. package/src/features/billing/stripe-product/stripe-product.module.ts +9 -0
  207. package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +304 -0
  208. package/src/features/billing/stripe-subscription/components/containers/index.ts +1 -0
  209. package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +223 -0
  210. package/src/features/billing/stripe-subscription/components/details/index.ts +1 -0
  211. package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx +116 -0
  212. package/src/features/billing/stripe-subscription/components/forms/SubscriptionEditor.tsx +331 -0
  213. package/src/features/billing/stripe-subscription/components/forms/index.ts +2 -0
  214. package/src/features/billing/stripe-subscription/components/index.ts +5 -0
  215. package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +104 -0
  216. package/src/features/billing/stripe-subscription/components/lists/index.ts +1 -0
  217. package/src/features/billing/stripe-subscription/components/widgets/PricingCard.tsx +95 -0
  218. package/src/features/billing/stripe-subscription/components/widgets/PricingCardsGrid.tsx +110 -0
  219. package/src/features/billing/stripe-subscription/components/widgets/ProrationPreview.tsx +41 -0
  220. package/src/features/billing/stripe-subscription/components/widgets/SubscriptionStatusBadge.tsx +60 -0
  221. package/src/features/billing/stripe-subscription/components/widgets/index.ts +4 -0
  222. package/src/features/billing/stripe-subscription/data/index.ts +3 -0
  223. package/src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts +66 -0
  224. package/src/features/billing/stripe-subscription/data/stripe-subscription.service.ts +193 -0
  225. package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +135 -0
  226. package/src/features/billing/stripe-subscription/hooks/index.ts +1 -0
  227. package/src/features/billing/stripe-subscription/hooks/useConfirmSubscriptionPayment.ts +111 -0
  228. package/src/features/billing/stripe-subscription/index.ts +5 -0
  229. package/src/features/billing/stripe-subscription/stripe-subscription.module.ts +9 -0
  230. package/src/features/billing/stripe-usage/components/containers/UsageContainer.tsx +109 -0
  231. package/src/features/billing/stripe-usage/components/containers/index.ts +1 -0
  232. package/src/features/billing/stripe-usage/components/details/UsageSummaryCard.tsx +90 -0
  233. package/src/features/billing/stripe-usage/components/details/index.ts +1 -0
  234. package/src/features/billing/stripe-usage/components/index.ts +4 -0
  235. package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +72 -0
  236. package/src/features/billing/stripe-usage/components/lists/index.ts +1 -0
  237. package/src/features/billing/stripe-usage/components/widgets/UsageSummaryCards.tsx +19 -0
  238. package/src/features/billing/stripe-usage/components/widgets/index.ts +1 -0
  239. package/src/features/billing/stripe-usage/data/index.ts +3 -0
  240. package/src/features/billing/stripe-usage/data/stripe-usage.interface.ts +55 -0
  241. package/src/features/billing/stripe-usage/data/stripe-usage.service.ts +129 -0
  242. package/src/features/billing/stripe-usage/data/stripe-usage.ts +70 -0
  243. package/src/features/billing/stripe-usage/index.ts +2 -0
  244. package/src/features/billing/stripe-usage/stripe-usage.module.ts +9 -0
  245. package/src/features/company/components/forms/CompanyEditor.tsx +2 -2
  246. package/src/features/company/contexts/CompanyContext.tsx +2 -2
  247. package/src/features/feature/components/forms/FormFeatures.tsx +13 -106
  248. package/src/features/feature/data/feature.interface.ts +1 -1
  249. package/src/features/feature/data/feature.ts +4 -4
  250. package/src/features/index.ts +7 -0
  251. package/src/features/module/data/module.interface.ts +0 -1
  252. package/src/features/module/data/module.ts +0 -6
  253. package/src/features/user/components/lists/ContributorsList.tsx +2 -2
  254. package/src/features/user/components/widgets/UserAvatar.tsx +1 -1
  255. package/src/index.ts +1 -1
  256. package/src/shadcnui/custom/link.tsx +16 -6
  257. package/src/utils/blocknote-diff.util.ts +2 -1
  258. package/src/utils/blocknote-word-diff-renderer.util.ts +8 -7
  259. package/dist/AuthComponent-hxOPs9o8.d.mts +0 -11
  260. package/dist/AuthComponent-hxOPs9o8.d.ts +0 -11
  261. package/dist/JsonApiRequest-FXZCYIER.js +0 -24
  262. package/dist/chunk-6YD42BP6.js.map +0 -1
  263. package/dist/chunk-C6QXZGL7.js.map +0 -1
  264. package/dist/chunk-FPZPD4JI.js.map +0 -1
  265. package/dist/chunk-JGVXZS7M.mjs.map +0 -1
  266. package/dist/chunk-PK5DRSUD.js.map +0 -1
  267. package/dist/chunk-SJIVGCNM.mjs.map +0 -1
  268. package/dist/chunk-TGBXBUWM.mjs.map +0 -1
  269. package/dist/chunk-WAFOKMKT.mjs.map +0 -1
  270. /package/dist/{BlockNoteEditor-ITJLAOXC.mjs.map → BlockNoteEditor-HFX7Z5BQ.mjs.map} +0 -0
  271. /package/dist/{JsonApiRequest-HFWXMKMA.mjs.map → JsonApiRequest-6IPS3DZJ.mjs.map} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9;
2
2
 
3
3
  var _chunkIBS6NI7Djs = require('./chunk-IBS6NI7D.js');
4
4
 
@@ -11,7 +11,7 @@ var _chunkIBS6NI7Djs = require('./chunk-IBS6NI7D.js');
11
11
 
12
12
 
13
13
 
14
- var _chunkFPZPD4JIjs = require('./chunk-FPZPD4JI.js');
14
+ var _chunkGPGJNTHPjs = require('./chunk-GPGJNTHP.js');
15
15
 
16
16
 
17
17
  var _chunkLXKSUWAVjs = require('./chunk-LXKSUWAV.js');
@@ -25,12 +25,12 @@ var RehydrationFactory = class {
25
25
  _chunk7QVYU63Ejs.__name.call(void 0, this, "RehydrationFactory");
26
26
  }
27
27
  static rehydrate(classKey, data) {
28
- const factoryClass = _chunkFPZPD4JIjs.DataClassRegistry.get(classKey);
28
+ const factoryClass = _chunkGPGJNTHPjs.DataClassRegistry.get(classKey);
29
29
  const instance = new factoryClass();
30
30
  return instance.rehydrate(data);
31
31
  }
32
32
  static rehydrateList(classKey, data) {
33
- const factoryClass = _chunkFPZPD4JIjs.DataClassRegistry.get(classKey);
33
+ const factoryClass = _chunkGPGJNTHPjs.DataClassRegistry.get(classKey);
34
34
  const response = data.map((item) => {
35
35
  const instance = new factoryClass();
36
36
  return instance.rehydrate(item);
@@ -272,7 +272,7 @@ var AbstractService = class {
272
272
  * Make an API call with automatic environment detection and error handling.
273
273
  */
274
274
  static async callApi(params) {
275
- const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-FXZCYIER.js")));
275
+ const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-45CLE65I.js")));
276
276
  let apiResponse;
277
277
  let language = "en";
278
278
  if (typeof window === "undefined") {
@@ -353,11 +353,96 @@ var AbstractService = class {
353
353
  if (apiResponse.self && params.self) params.self.self = apiResponse.self;
354
354
  return apiResponse.data;
355
355
  }
356
+ /**
357
+ * Make an API call and return both data and meta from the response.
358
+ */
359
+ static async callApiWithMeta(params) {
360
+ const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-45CLE65I.js")));
361
+ let apiResponse;
362
+ let language = "en";
363
+ if (typeof window === "undefined") {
364
+ const { getLocale } = await Promise.resolve().then(() => _interopRequireWildcard(require("next-intl/server")));
365
+ language = await _asyncNullishCoalesce(await getLocale(), async () => ( "en"));
366
+ } else {
367
+ language = this.getClientLocale();
368
+ }
369
+ switch (params.method) {
370
+ case "GET" /* GET */:
371
+ apiResponse = await JsonApiGet2({
372
+ classKey: params.type,
373
+ endpoint: params.endpoint,
374
+ companyId: params.companyId,
375
+ language
376
+ });
377
+ break;
378
+ case "POST" /* POST */:
379
+ apiResponse = await JsonApiPost2({
380
+ classKey: params.type,
381
+ endpoint: params.endpoint,
382
+ companyId: params.companyId,
383
+ body: params.input,
384
+ overridesJsonApiCreation: params.overridesJsonApiCreation,
385
+ language,
386
+ responseType: params.responseType,
387
+ files: params.files
388
+ });
389
+ break;
390
+ case "PUT" /* PUT */:
391
+ apiResponse = await JsonApiPut({
392
+ classKey: params.type,
393
+ endpoint: params.endpoint,
394
+ companyId: params.companyId,
395
+ body: params.input,
396
+ language,
397
+ responseType: params.responseType,
398
+ files: params.files
399
+ });
400
+ break;
401
+ case "PATCH" /* PATCH */:
402
+ apiResponse = await JsonApiPatch({
403
+ classKey: params.type,
404
+ endpoint: params.endpoint,
405
+ companyId: params.companyId,
406
+ body: params.input,
407
+ overridesJsonApiCreation: params.overridesJsonApiCreation,
408
+ language,
409
+ responseType: params.responseType,
410
+ files: params.files
411
+ });
412
+ break;
413
+ case "DELETE" /* DELETE */:
414
+ apiResponse = await JsonApiDelete2({
415
+ classKey: params.type,
416
+ endpoint: params.endpoint,
417
+ companyId: params.companyId,
418
+ language,
419
+ responseType: params.responseType
420
+ });
421
+ break;
422
+ default:
423
+ throw new Error("Method not found");
424
+ }
425
+ if (!apiResponse.ok) {
426
+ if (globalErrorHandler && typeof window !== "undefined") {
427
+ globalErrorHandler(apiResponse.response, apiResponse.error);
428
+ return { data: void 0, meta: void 0 };
429
+ } else {
430
+ const error = new Error(`${apiResponse.error}`);
431
+ error.status = apiResponse.response;
432
+ error.digest = `HTTP_${apiResponse.response}`;
433
+ throw error;
434
+ }
435
+ }
436
+ return {
437
+ data: apiResponse.data,
438
+ meta: apiResponse.meta
439
+ };
440
+ }
356
441
  /**
357
442
  * Get raw JSON:API response data without deserialization.
358
443
  */
359
444
  static async getRawData(params) {
360
- const { JsonApiGet: JsonApiGet2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-FXZCYIER.js")));
445
+ const { JsonApiGet: JsonApiGet2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-45CLE65I.js")));
361
446
  let language = "en";
362
447
  if (typeof window === "undefined") {
363
448
  const { getLocale } = await Promise.resolve().then(() => _interopRequireWildcard(require("next-intl/server")));
@@ -391,7 +476,7 @@ var _clientConfig = null;
391
476
  function configureClientJsonApi(config) {
392
477
  _clientConfig = config;
393
478
  if (config.bootstrapper) {
394
- _chunkFPZPD4JIjs.setBootstrapper.call(void 0, config.bootstrapper);
479
+ _chunkGPGJNTHPjs.setBootstrapper.call(void 0, config.bootstrapper);
395
480
  config.bootstrapper();
396
481
  }
397
482
  }
@@ -448,7 +533,7 @@ async function ClientJsonApiGet(params) {
448
533
  language: params.language,
449
534
  additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _15 => _15.additionalHeaders])
450
535
  });
451
- return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
536
+ return _chunkGPGJNTHPjs.translateResponse.call(void 0, {
452
537
  classKey: params.classKey,
453
538
  apiResponse,
454
539
  companyId: params.companyId,
@@ -469,7 +554,7 @@ async function ClientJsonApiPost(params) {
469
554
  if (!body) {
470
555
  body = {};
471
556
  } else if (params.overridesJsonApiCreation !== true) {
472
- body = _chunkFPZPD4JIjs.JsonApiDataFactory.create(params.classKey, body);
557
+ body = _chunkGPGJNTHPjs.JsonApiDataFactory.create(params.classKey, body);
473
558
  }
474
559
  const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
475
560
  method: "POST",
@@ -481,7 +566,7 @@ async function ClientJsonApiPost(params) {
481
566
  language: params.language,
482
567
  additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _16 => _16.additionalHeaders])
483
568
  });
484
- return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
569
+ return _chunkGPGJNTHPjs.translateResponse.call(void 0, {
485
570
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
486
571
  apiResponse,
487
572
  companyId: params.companyId,
@@ -496,7 +581,7 @@ async function ClientJsonApiPut(params) {
496
581
  if (!body) {
497
582
  body = {};
498
583
  } else {
499
- body = _chunkFPZPD4JIjs.JsonApiDataFactory.create(params.classKey, body);
584
+ body = _chunkGPGJNTHPjs.JsonApiDataFactory.create(params.classKey, body);
500
585
  }
501
586
  const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
502
587
  method: "PUT",
@@ -508,7 +593,7 @@ async function ClientJsonApiPut(params) {
508
593
  language: params.language,
509
594
  additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _17 => _17.additionalHeaders])
510
595
  });
511
- return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
596
+ return _chunkGPGJNTHPjs.translateResponse.call(void 0, {
512
597
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
513
598
  apiResponse,
514
599
  companyId: params.companyId,
@@ -523,7 +608,7 @@ async function ClientJsonApiPatch(params) {
523
608
  if (!body) {
524
609
  body = {};
525
610
  } else if (params.overridesJsonApiCreation !== true) {
526
- body = _chunkFPZPD4JIjs.JsonApiDataFactory.create(params.classKey, body);
611
+ body = _chunkGPGJNTHPjs.JsonApiDataFactory.create(params.classKey, body);
527
612
  }
528
613
  const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
529
614
  method: "PATCH",
@@ -535,7 +620,7 @@ async function ClientJsonApiPatch(params) {
535
620
  language: params.language,
536
621
  additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _18 => _18.additionalHeaders])
537
622
  });
538
- return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
623
+ return _chunkGPGJNTHPjs.translateResponse.call(void 0, {
539
624
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
540
625
  apiResponse,
541
626
  companyId: params.companyId,
@@ -554,7 +639,7 @@ async function ClientJsonApiDelete(params) {
554
639
  language: params.language,
555
640
  additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _19 => _19.additionalHeaders])
556
641
  });
557
- return _chunkFPZPD4JIjs.translateResponse.call(void 0, {
642
+ return _chunkGPGJNTHPjs.translateResponse.call(void 0, {
558
643
  classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
559
644
  apiResponse,
560
645
  companyId: params.companyId,
@@ -756,7 +841,7 @@ var ModuleRegistrar = (_class = class {
756
841
  }).map((key) => modulesClass[key]);
757
842
  data.forEach((item) => {
758
843
  if (item && item.model) {
759
- _chunkFPZPD4JIjs.DataClassRegistry.registerObjectClass(item, item.model);
844
+ _chunkGPGJNTHPjs.DataClassRegistry.registerObjectClass(item, item.model);
760
845
  }
761
846
  });
762
847
  this._isBootstrapped = true;
@@ -766,7 +851,7 @@ var ModuleRegistrar = (_class = class {
766
851
  */
767
852
  static reset() {
768
853
  this._isBootstrapped = false;
769
- _chunkFPZPD4JIjs.DataClassRegistry.clear();
854
+ _chunkGPGJNTHPjs.DataClassRegistry.clear();
770
855
  }
771
856
  }, _class.__initStatic(), _class);
772
857
 
@@ -789,20 +874,20 @@ var ModuleRegistryClass = class {
789
874
  get(name) {
790
875
  let module = this._modules.get(name);
791
876
  if (!module) {
792
- const didBootstrap = _chunkFPZPD4JIjs.tryBootstrap.call(void 0, );
877
+ const didBootstrap = _chunkGPGJNTHPjs.tryBootstrap.call(void 0, );
793
878
  if (didBootstrap) {
794
879
  module = this._modules.get(name);
795
880
  }
796
881
  }
797
882
  if (!module) {
798
- const hint = _chunkFPZPD4JIjs.hasBootstrapper.call(void 0, ) ? "Bootstrap was called but module still not found. Check module registration." : "No bootstrapper registered. Ensure configureJsonApi({ bootstrapper }) is called before accessing modules.";
883
+ const hint = _chunkGPGJNTHPjs.hasBootstrapper.call(void 0, ) ? "Bootstrap was called but module still not found. Check module registration." : "No bootstrapper registered. Ensure configureJsonApi({ bootstrapper }) is called before accessing modules.";
799
884
  throw new Error(`Module "${String(name)}" not registered. ${hint}`);
800
885
  }
801
886
  return module;
802
887
  }
803
888
  findByName(moduleName) {
804
889
  if (this._modules.size === 0) {
805
- _chunkFPZPD4JIjs.tryBootstrap.call(void 0, );
890
+ _chunkGPGJNTHPjs.tryBootstrap.call(void 0, );
806
891
  }
807
892
  for (const module of this._modules.values()) {
808
893
  if (module.name === moduleName) {
@@ -814,7 +899,7 @@ var ModuleRegistryClass = class {
814
899
  findByModelName(modelName) {
815
900
  let module = this._modules.get(modelName);
816
901
  if (!module) {
817
- const didBootstrap = _chunkFPZPD4JIjs.tryBootstrap.call(void 0, );
902
+ const didBootstrap = _chunkGPGJNTHPjs.tryBootstrap.call(void 0, );
818
903
  if (didBootstrap) {
819
904
  module = this._modules.get(modelName);
820
905
  }
@@ -894,7 +979,8 @@ var EndpointCreator = class {
894
979
  if (this._endpoint.additionalParams) {
895
980
  additionalParams = this._endpoint.additionalParams.map((param) => `${param.key}=${param.value}`).join("&");
896
981
  }
897
- let response = `${this._endpoint.endpoint.name}`;
982
+ let response = ``;
983
+ response += `${typeof this._endpoint.endpoint === "string" ? this._endpoint.endpoint : this._endpoint.endpoint.name}`;
898
984
  if (this._endpoint.id) response += `/${this._endpoint.id}`;
899
985
  if (this._endpoint.childEndpoint) {
900
986
  response += `/${typeof this._endpoint.childEndpoint === "string" ? this._endpoint.childEndpoint : this._endpoint.childEndpoint.name}`;
@@ -1096,6 +1182,7 @@ var entityObjectSchema = _zod.z.object({
1096
1182
  });
1097
1183
 
1098
1184
  // src/utils/blocknote-diff.util.ts
1185
+ var _uuid = require('uuid');
1099
1186
  var BlockNoteDiffUtil = (_class2 = class {
1100
1187
  static {
1101
1188
  _chunk7QVYU63Ejs.__name.call(void 0, this, "BlockNoteDiffUtil");
@@ -1126,7 +1213,7 @@ var BlockNoteDiffUtil = (_class2 = class {
1126
1213
  const processedNewIds = /* @__PURE__ */ new Set();
1127
1214
  for (const originalBlock of originalBlocks) {
1128
1215
  const blockId = originalBlock.id;
1129
- const processId = blockId || crypto.randomUUID();
1216
+ const processId = blockId || _uuid.v4.call(void 0, );
1130
1217
  const newBlock = blockId ? newMap.get(blockId) : null;
1131
1218
  if (!newBlock) {
1132
1219
  const removedBlock = {
@@ -1672,6 +1759,7 @@ var BlockNoteDiffUtil = (_class2 = class {
1672
1759
  }, _class2.__initStatic2(), _class2);
1673
1760
 
1674
1761
  // src/utils/blocknote-word-diff-renderer.util.ts
1762
+
1675
1763
  var BlockNoteWordDiffRendererUtil = class {
1676
1764
  static {
1677
1765
  _chunk7QVYU63Ejs.__name.call(void 0, this, "BlockNoteWordDiffRendererUtil");
@@ -1714,7 +1802,7 @@ var BlockNoteWordDiffRendererUtil = class {
1714
1802
  return this.renderBlockLevelDiff(block, onAcceptChange, onRejectChange);
1715
1803
  }
1716
1804
  const baseBlock = {
1717
- id: block.id || crypto.randomUUID(),
1805
+ id: block.id || _uuid.v4.call(void 0, ),
1718
1806
  type: block.type || "paragraph",
1719
1807
  props: this.getBlockProps(block),
1720
1808
  content: Array.isArray(block.content) ? block.content : [],
@@ -1727,7 +1815,7 @@ var BlockNoteWordDiffRendererUtil = class {
1727
1815
  static renderBlockLevelDiff(block, onAcceptChange, onRejectChange) {
1728
1816
  if (!block.diffId) {
1729
1817
  return {
1730
- id: block.id || crypto.randomUUID(),
1818
+ id: block.id || _uuid.v4.call(void 0, ),
1731
1819
  type: block.type || "paragraph",
1732
1820
  props: block.props || {},
1733
1821
  content: Array.isArray(block.content) ? block.content : [],
@@ -1742,7 +1830,7 @@ var BlockNoteWordDiffRendererUtil = class {
1742
1830
  if (block.diffType === "added") {
1743
1831
  if (blockRejected) {
1744
1832
  return {
1745
- id: block.id || crypto.randomUUID(),
1833
+ id: block.id || _uuid.v4.call(void 0, ),
1746
1834
  type: "paragraph",
1747
1835
  props: {},
1748
1836
  content: [],
@@ -1761,7 +1849,7 @@ var BlockNoteWordDiffRendererUtil = class {
1761
1849
  } else if (block.diffType === "removed") {
1762
1850
  if (blockAccepted) {
1763
1851
  return {
1764
- id: block.id || crypto.randomUUID(),
1852
+ id: block.id || _uuid.v4.call(void 0, ),
1765
1853
  type: "paragraph",
1766
1854
  props: {},
1767
1855
  content: [],
@@ -1779,7 +1867,7 @@ var BlockNoteWordDiffRendererUtil = class {
1779
1867
  }
1780
1868
  }
1781
1869
  const baseBlock = {
1782
- id: block.id || crypto.randomUUID(),
1870
+ id: block.id || _uuid.v4.call(void 0, ),
1783
1871
  type: block.type || "paragraph",
1784
1872
  props: this.getBlockProps(block),
1785
1873
  content,
@@ -1792,7 +1880,7 @@ var BlockNoteWordDiffRendererUtil = class {
1792
1880
  static renderWordLevelDiff(block, onAcceptChange, onRejectChange) {
1793
1881
  if (!block.wordDiffs) {
1794
1882
  return {
1795
- id: block.id || crypto.randomUUID(),
1883
+ id: block.id || _uuid.v4.call(void 0, ),
1796
1884
  type: block.type || "paragraph",
1797
1885
  props: block.props || {},
1798
1886
  content: Array.isArray(block.content) ? block.content : [],
@@ -1801,7 +1889,7 @@ var BlockNoteWordDiffRendererUtil = class {
1801
1889
  }
1802
1890
  const content = this.groupAndRenderWordDiffs(block.wordDiffs);
1803
1891
  return {
1804
- id: block.id || crypto.randomUUID(),
1892
+ id: block.id || _uuid.v4.call(void 0, ),
1805
1893
  type: block.type || "paragraph",
1806
1894
  props: block.props || {},
1807
1895
  content: Array.isArray(content) ? content : [],
@@ -2111,6 +2199,17 @@ function getValueFromPath(obj, path, userId) {
2111
2199
  }
2112
2200
  _chunk7QVYU63Ejs.__name.call(void 0, getValueFromPath, "getValueFromPath");
2113
2201
 
2202
+ // src/features/auth/config.ts
2203
+ var _tokenHandler = null;
2204
+ function configureAuth(handler) {
2205
+ _tokenHandler = handler;
2206
+ }
2207
+ _chunk7QVYU63Ejs.__name.call(void 0, configureAuth, "configureAuth");
2208
+ function getTokenHandler() {
2209
+ return _tokenHandler;
2210
+ }
2211
+ _chunk7QVYU63Ejs.__name.call(void 0, getTokenHandler, "getTokenHandler");
2212
+
2114
2213
  // src/features/auth/data/auth.ts
2115
2214
  var Auth = class extends AbstractApiData {
2116
2215
  static {
@@ -2156,17 +2255,6 @@ var Auth = class extends AbstractApiData {
2156
2255
  }
2157
2256
  };
2158
2257
 
2159
- // src/features/auth/config.ts
2160
- var _tokenHandler = null;
2161
- function configureAuth(handler) {
2162
- _tokenHandler = handler;
2163
- }
2164
- _chunk7QVYU63Ejs.__name.call(void 0, configureAuth, "configureAuth");
2165
- function getTokenHandler() {
2166
- return _tokenHandler;
2167
- }
2168
- _chunk7QVYU63Ejs.__name.call(void 0, getTokenHandler, "getTokenHandler");
2169
-
2170
2258
  // src/features/auth/data/auth.service.ts
2171
2259
  var AuthService = class extends AbstractService {
2172
2260
  static {
@@ -2174,7 +2262,7 @@ var AuthService = class extends AbstractService {
2174
2262
  }
2175
2263
  static async login(params) {
2176
2264
  const language = params.language || "en-US";
2177
- const apiResponse = await _chunkFPZPD4JIjs.JsonApiPost.call(void 0, {
2265
+ const apiResponse = await _chunkGPGJNTHPjs.JsonApiPost.call(void 0, {
2178
2266
  classKey: Modules.Auth,
2179
2267
  endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "login" }).generate(),
2180
2268
  body: { email: params.email, password: params.password },
@@ -2202,7 +2290,7 @@ var AuthService = class extends AbstractService {
2202
2290
  }
2203
2291
  static async logout(params) {
2204
2292
  const language = _optionalChain([params, 'optionalAccess', _51 => _51.language]) || "en-US";
2205
- await _chunkFPZPD4JIjs.JsonApiDelete.call(void 0, {
2293
+ await _chunkGPGJNTHPjs.JsonApiDelete.call(void 0, {
2206
2294
  classKey: Modules.Auth,
2207
2295
  endpoint: new EndpointCreator({ endpoint: Modules.Auth }).generate(),
2208
2296
  language
@@ -2214,7 +2302,7 @@ var AuthService = class extends AbstractService {
2214
2302
  }
2215
2303
  static async initialiseForgotPassword(params) {
2216
2304
  const language = params.language || "en-US";
2217
- const response = await _chunkFPZPD4JIjs.JsonApiPost.call(void 0, {
2305
+ const response = await _chunkGPGJNTHPjs.JsonApiPost.call(void 0, {
2218
2306
  classKey: Modules.Auth,
2219
2307
  endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "forgot" }).generate(),
2220
2308
  body: { email: params.email },
@@ -2243,7 +2331,7 @@ var AuthService = class extends AbstractService {
2243
2331
  }
2244
2332
  static async validateCode(params) {
2245
2333
  const language = params.language || "en-US";
2246
- const apiResponse = await _chunkFPZPD4JIjs.JsonApiGet.call(void 0, {
2334
+ const apiResponse = await _chunkGPGJNTHPjs.JsonApiGet.call(void 0, {
2247
2335
  classKey: Modules.Auth,
2248
2336
  endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "validate", childEndpoint: params.code }).generate(),
2249
2337
  language
@@ -2307,10 +2395,131 @@ var AuthModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory)
2307
2395
  model: Auth
2308
2396
  }), "AuthModule");
2309
2397
 
2310
- // src/features/company/data/company.ts
2311
- var Company = class extends AbstractApiData {
2398
+ // src/features/billing/data/billing.service.ts
2399
+ var BillingService = class extends AbstractService {
2312
2400
  static {
2313
- _chunk7QVYU63Ejs.__name.call(void 0, this, "Company");
2401
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "BillingService");
2402
+ }
2403
+ // ============================================================================
2404
+ // Meter Methods (kept here for backwards compatibility)
2405
+ // ============================================================================
2406
+ /**
2407
+ * List all available usage meters
2408
+ * @deprecated Use StripeUsageService.listMeters() instead
2409
+ */
2410
+ static async listMeters(params) {
2411
+ const endpoint = new EndpointCreator({
2412
+ endpoint: Modules.StripeUsage,
2413
+ childEndpoint: "meters"
2414
+ });
2415
+ return this.callApi({
2416
+ type: Modules.StripeUsage,
2417
+ method: "GET" /* GET */,
2418
+ endpoint: endpoint.generate(),
2419
+ next: _optionalChain([params, 'optionalAccess', _63 => _63.next]),
2420
+ previous: _optionalChain([params, 'optionalAccess', _64 => _64.prev])
2421
+ });
2422
+ }
2423
+ /**
2424
+ * Get meter summaries for a specific time period
2425
+ * @deprecated Use StripeUsageService.getMeterSummaries() instead
2426
+ */
2427
+ static async getMeterSummaries(params) {
2428
+ const endpoint = new EndpointCreator({
2429
+ endpoint: Modules.StripeUsage,
2430
+ childEndpoint: `meters/${params.meterId}/summaries`
2431
+ });
2432
+ endpoint.addAdditionalParam("startTime", params.startTime.toISOString());
2433
+ endpoint.addAdditionalParam("endTime", params.endTime.toISOString());
2434
+ return this.callApi({
2435
+ type: Modules.StripeUsage,
2436
+ method: "GET" /* GET */,
2437
+ endpoint: endpoint.generate()
2438
+ });
2439
+ }
2440
+ };
2441
+
2442
+ // src/features/billing/data/Billing.ts
2443
+ var Billing = class extends AbstractApiData {
2444
+ static {
2445
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Billing");
2446
+ }
2447
+ rehydrate(data) {
2448
+ super.rehydrate(data);
2449
+ return this;
2450
+ }
2451
+ createJsonApi(_data) {
2452
+ throw new Error("Billing is a namespace module and cannot be created");
2453
+ }
2454
+ };
2455
+
2456
+ // src/features/billing/modules/billing.module.ts
2457
+ var BillingModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
2458
+ name: "billing",
2459
+ model: Billing,
2460
+ moduleId: "3266b307-5a9a-46f9-b78d-631f672f8735"
2461
+ }), "BillingModule");
2462
+
2463
+ // src/features/billing/stripe-customer/data/payment-method.ts
2464
+ var PaymentMethod = class extends AbstractApiData {
2465
+ static {
2466
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "PaymentMethod");
2467
+ }
2468
+
2469
+
2470
+
2471
+ get type() {
2472
+ if (!this._paymentType) throw new Error("type is not defined");
2473
+ return this._paymentType;
2474
+ }
2475
+ get card() {
2476
+ return this._card;
2477
+ }
2478
+ get billingDetails() {
2479
+ return this._billingDetails;
2480
+ }
2481
+ rehydrate(data) {
2482
+ super.rehydrate(data);
2483
+ const attrs = data.jsonApi.attributes;
2484
+ this._paymentType = attrs.type;
2485
+ if (attrs.brand || attrs.last4 || attrs.expMonth || attrs.expYear) {
2486
+ this._card = {
2487
+ brand: attrs.brand,
2488
+ last4: attrs.last4,
2489
+ expMonth: attrs.expMonth,
2490
+ expYear: attrs.expYear
2491
+ };
2492
+ }
2493
+ const hasAddress = attrs.billingAddressCity || attrs.billingAddressCountry || attrs.billingAddressLine1 || attrs.billingAddressLine2 || attrs.billingAddressPostalCode || attrs.billingAddressState;
2494
+ const hasBillingDetails = attrs.billingName || attrs.billingEmail || attrs.billingPhone || hasAddress;
2495
+ if (hasBillingDetails) {
2496
+ this._billingDetails = {
2497
+ name: _nullishCoalesce(attrs.billingName, () => ( void 0)),
2498
+ email: _nullishCoalesce(attrs.billingEmail, () => ( void 0)),
2499
+ phone: _nullishCoalesce(attrs.billingPhone, () => ( void 0))
2500
+ };
2501
+ if (hasAddress) {
2502
+ this._billingDetails.address = {
2503
+ city: _nullishCoalesce(attrs.billingAddressCity, () => ( void 0)),
2504
+ country: _nullishCoalesce(attrs.billingAddressCountry, () => ( void 0)),
2505
+ line1: _nullishCoalesce(attrs.billingAddressLine1, () => ( void 0)),
2506
+ line2: _nullishCoalesce(attrs.billingAddressLine2, () => ( void 0)),
2507
+ postalCode: _nullishCoalesce(attrs.billingAddressPostalCode, () => ( void 0)),
2508
+ state: _nullishCoalesce(attrs.billingAddressState, () => ( void 0))
2509
+ };
2510
+ }
2511
+ }
2512
+ return this;
2513
+ }
2514
+ createJsonApi(_data) {
2515
+ throw new Error("PaymentMethod is managed by Stripe and cannot be created directly");
2516
+ }
2517
+ };
2518
+
2519
+ // src/features/billing/stripe-customer/data/stripe-customer.ts
2520
+ var StripeCustomer = (_class3 = class extends AbstractApiData {constructor(...args) { super(...args); _class3.prototype.__init.call(this); }
2521
+ static {
2522
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeCustomer");
2314
2523
  }
2315
2524
 
2316
2525
 
@@ -2318,109 +2527,1339 @@ var Company = class extends AbstractApiData {
2318
2527
 
2319
2528
 
2320
2529
 
2530
+ __init() {this._delinquent = false}
2321
2531
 
2532
+ get stripeCustomerId() {
2533
+ if (!this._stripeCustomerId) throw new Error("stripeCustomerId is not defined");
2534
+ return this._stripeCustomerId;
2535
+ }
2536
+ get email() {
2537
+ return this._email;
2538
+ }
2322
2539
  get name() {
2323
- if (this._name === void 0) throw new Error("Name is not defined");
2324
2540
  return this._name;
2325
2541
  }
2326
- get logo() {
2327
- return this._logo;
2328
- }
2329
- get logoUrl() {
2330
- return this._logoUrl;
2542
+ get defaultPaymentMethodId() {
2543
+ return this._defaultPaymentMethodId;
2331
2544
  }
2332
- get licenseExpirationDate() {
2333
- return this._licenseExpirationDate;
2545
+ get currency() {
2546
+ return this._currency;
2334
2547
  }
2335
- get features() {
2336
- return _nullishCoalesce(this._features, () => ( []));
2548
+ get balance() {
2549
+ return this._balance;
2337
2550
  }
2338
- get modules() {
2339
- return _nullishCoalesce(this._modules, () => ( []));
2551
+ get delinquent() {
2552
+ return this._delinquent;
2340
2553
  }
2341
- get configurations() {
2342
- return this._configurations;
2554
+ get metadata() {
2555
+ return this._metadata;
2343
2556
  }
2344
2557
  rehydrate(data) {
2345
2558
  super.rehydrate(data);
2559
+ this._stripeCustomerId = data.jsonApi.attributes.stripeCustomerId;
2560
+ this._email = data.jsonApi.attributes.email;
2346
2561
  this._name = data.jsonApi.attributes.name;
2347
- this._configurations = data.jsonApi.attributes.configurations ? JSON.parse(data.jsonApi.attributes.configurations) : void 0;
2348
- this._logo = data.jsonApi.attributes.logo;
2349
- this._logoUrl = data.jsonApi.attributes.logoUrl;
2350
- this._licenseExpirationDate = data.jsonApi.attributes.licenseExpirationDate ? new Date(data.jsonApi.attributes.licenseExpirationDate) : void 0;
2351
- this._features = this._readIncluded(data, "features", Modules.Feature);
2352
- this._modules = this._readIncluded(data, "modules", Modules.Module);
2562
+ this._defaultPaymentMethodId = data.jsonApi.attributes.defaultPaymentMethodId;
2563
+ this._currency = data.jsonApi.attributes.currency;
2564
+ this._balance = data.jsonApi.attributes.balance;
2565
+ this._delinquent = _nullishCoalesce(data.jsonApi.attributes.delinquent, () => ( false));
2566
+ this._metadata = data.jsonApi.attributes.metadata ? typeof data.jsonApi.attributes.metadata === "string" ? JSON.parse(data.jsonApi.attributes.metadata) : data.jsonApi.attributes.metadata : void 0;
2353
2567
  return this;
2354
2568
  }
2355
- createJsonApi(data) {
2356
- const response = {
2357
- data: {
2358
- type: Modules.Company.name,
2359
- id: data.id,
2360
- attributes: {},
2361
- meta: {},
2362
- relationships: {}
2363
- },
2364
- included: []
2365
- };
2366
- if (data.name) response.data.attributes.name = data.name;
2367
- if (data.configurations) response.data.attributes.configurations = JSON.stringify(data.configurations);
2368
- if (data.logo) response.data.attributes.logo = data.logo;
2369
- if (data.license) response.data.attributes.license = data.license;
2370
- if (data.privateKey) response.data.attributes.privateKey = data.privateKey;
2371
- if (data.featureIds && data.featureIds.length > 0) {
2372
- response.data.relationships.features = {
2373
- data: data.featureIds.map((featureId) => ({
2374
- type: Modules.Feature.name,
2375
- id: featureId
2376
- }))
2377
- };
2378
- }
2379
- if (data.moduleIds && data.moduleIds.length > 0) {
2380
- response.data.relationships.modules = {
2381
- data: data.moduleIds.map((moduleId) => ({
2382
- type: Modules.Module.name,
2383
- id: moduleId
2384
- }))
2385
- };
2386
- }
2387
- return response;
2569
+ createJsonApi(_data) {
2570
+ throw new Error("BillingCustomer is managed by Stripe and cannot be created directly");
2388
2571
  }
2389
- };
2390
-
2391
- // src/features/company/data/company.fields.ts
2392
- var CompanyFields = /* @__PURE__ */ ((CompanyFields2) => {
2393
- CompanyFields2["companyId"] = "companyId";
2394
- CompanyFields2["name"] = "name";
2395
- CompanyFields2["createdAt"] = "createdAt";
2396
- CompanyFields2["updatedAt"] = "updatedAt";
2397
- return CompanyFields2;
2398
- })(CompanyFields || {});
2572
+ }, _class3);
2399
2573
 
2400
- // src/features/company/data/company.service.ts
2401
- var CompanyService = class extends AbstractService {
2574
+ // src/features/billing/stripe-customer/data/stripe-customer.service.ts
2575
+ var StripeCustomerService = class extends AbstractService {
2402
2576
  static {
2403
- _chunk7QVYU63Ejs.__name.call(void 0, this, "CompanyService");
2577
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeCustomerService");
2404
2578
  }
2405
- static async findOne(params) {
2579
+ // ============================================================================
2580
+ // Customer Methods
2581
+ // ============================================================================
2582
+ /**
2583
+ * Get the current user's billing customer record
2584
+ */
2585
+ static async getCustomer() {
2586
+ const endpoint = new EndpointCreator({
2587
+ endpoint: Modules.StripeCustomer
2588
+ });
2406
2589
  return this.callApi({
2407
- type: Modules.Company,
2590
+ type: Modules.StripeCustomer,
2408
2591
  method: "GET" /* GET */,
2409
- endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.companyId }).generate()
2592
+ endpoint: endpoint.generate()
2410
2593
  });
2411
2594
  }
2412
- static async findMany(params) {
2413
- const endpoint = new EndpointCreator({ endpoint: Modules.Company });
2414
- if (params.search) endpoint.addAdditionalParam("search", params.search);
2595
+ /**
2596
+ * Create a billing customer for the current user
2597
+ */
2598
+ static async createCustomer() {
2599
+ const endpoint = new EndpointCreator({
2600
+ endpoint: Modules.StripeCustomer
2601
+ });
2415
2602
  return this.callApi({
2416
- type: Modules.Company,
2417
- method: "GET" /* GET */,
2418
- endpoint: endpoint.generate(),
2419
- next: params.next
2603
+ type: Modules.StripeCustomer,
2604
+ method: "POST" /* POST */,
2605
+ endpoint: endpoint.generate()
2420
2606
  });
2421
2607
  }
2422
- static async delete(params) {
2423
- await this.callApi({
2608
+ /**
2609
+ * Create a setup intent for adding payment methods
2610
+ */
2611
+ static async createSetupIntent() {
2612
+ const endpoint = new EndpointCreator({
2613
+ endpoint: Modules.Billing,
2614
+ childEndpoint: "setup-intent"
2615
+ });
2616
+ return this.callApi({
2617
+ type: Modules.Billing,
2618
+ method: "POST" /* POST */,
2619
+ endpoint: endpoint.generate()
2620
+ });
2621
+ }
2622
+ /**
2623
+ * Create a Stripe customer portal session URL
2624
+ */
2625
+ static async createPortalSession() {
2626
+ const endpoint = new EndpointCreator({
2627
+ endpoint: Modules.Billing,
2628
+ childEndpoint: "customers/portal-session"
2629
+ });
2630
+ return this.callApi({
2631
+ type: Modules.Billing,
2632
+ method: "POST" /* POST */,
2633
+ endpoint: endpoint.generate()
2634
+ });
2635
+ }
2636
+ // ============================================================================
2637
+ // Payment Method Methods
2638
+ // ============================================================================
2639
+ /**
2640
+ * List all payment methods for the current user
2641
+ */
2642
+ static async listPaymentMethods(params) {
2643
+ const endpoint = new EndpointCreator({
2644
+ endpoint: Modules.StripeCustomer,
2645
+ childEndpoint: "payment-methods"
2646
+ });
2647
+ return this.callApi({
2648
+ type: Modules.StripePaymentMethod,
2649
+ method: "GET" /* GET */,
2650
+ endpoint: endpoint.generate(),
2651
+ next: _optionalChain([params, 'optionalAccess', _65 => _65.next]),
2652
+ previous: _optionalChain([params, 'optionalAccess', _66 => _66.prev])
2653
+ });
2654
+ }
2655
+ /**
2656
+ * Set the default payment method for the current user
2657
+ */
2658
+ static async setDefaultPaymentMethod(params) {
2659
+ const endpoint = new EndpointCreator({
2660
+ endpoint: Modules.StripeCustomer,
2661
+ childEndpoint: `payment-methods/${params.paymentMethodId}/default`
2662
+ });
2663
+ return this.callApi({
2664
+ type: Modules.StripeCustomer,
2665
+ method: "POST" /* POST */,
2666
+ endpoint: endpoint.generate()
2667
+ });
2668
+ }
2669
+ /**
2670
+ * Remove a payment method
2671
+ */
2672
+ static async removePaymentMethod(params) {
2673
+ const endpoint = new EndpointCreator({
2674
+ endpoint: Modules.StripeCustomer,
2675
+ childEndpoint: `payment-methods/${params.paymentMethodId}`
2676
+ });
2677
+ await this.callApi({
2678
+ type: Modules.StripeCustomer,
2679
+ method: "DELETE" /* DELETE */,
2680
+ endpoint: endpoint.generate()
2681
+ });
2682
+ }
2683
+ };
2684
+
2685
+ // src/features/billing/stripe-customer/stripe-customer.module.ts
2686
+ var StripeCustomerModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
2687
+ name: "stripe-customers",
2688
+ model: StripeCustomer,
2689
+ moduleId: "25a80cb3-bf18-47fd-963a-639212519920"
2690
+ }), "StripeCustomerModule");
2691
+
2692
+ // src/features/billing/stripe-customer/stripe-payment-method.module.ts
2693
+ var StripePaymentMethodModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
2694
+ name: "stripe-payment-methods",
2695
+ model: PaymentMethod,
2696
+ moduleId: "e8f7d6c5-b4a3-4928-8170-1f2e3d4c5b6a"
2697
+ }), "StripePaymentMethodModule");
2698
+
2699
+ // src/features/billing/stripe-invoice/data/stripe-invoice.ts
2700
+ var StripeInvoice = (_class4 = class extends AbstractApiData {constructor(...args2) { super(...args2); _class4.prototype.__init2.call(this);_class4.prototype.__init3.call(this);_class4.prototype.__init4.call(this); }
2701
+ static {
2702
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeInvoice");
2703
+ }
2704
+
2705
+
2706
+
2707
+
2708
+
2709
+
2710
+
2711
+
2712
+
2713
+
2714
+
2715
+
2716
+
2717
+
2718
+
2719
+
2720
+
2721
+ __init2() {this._attemptCount = 0}
2722
+ __init3() {this._attempted = false}
2723
+
2724
+
2725
+ __init4() {this._paid = false}
2726
+
2727
+ get stripeInvoiceId() {
2728
+ if (!this._stripeInvoiceId) throw new Error("stripeInvoiceId is not defined");
2729
+ return this._stripeInvoiceId;
2730
+ }
2731
+ get stripeInvoiceNumber() {
2732
+ return this._stripeInvoiceNumber;
2733
+ }
2734
+ get customerId() {
2735
+ return this._customerId;
2736
+ }
2737
+ get subscriptionId() {
2738
+ return this._subscriptionId;
2739
+ }
2740
+ get subscription() {
2741
+ return this._subscription;
2742
+ }
2743
+ get status() {
2744
+ if (!this._status) throw new Error("status is not defined");
2745
+ return this._status;
2746
+ }
2747
+ get amountDue() {
2748
+ if (this._amountDue === void 0) throw new Error("amountDue is not defined");
2749
+ return this._amountDue;
2750
+ }
2751
+ get amountPaid() {
2752
+ if (this._amountPaid === void 0) throw new Error("amountPaid is not defined");
2753
+ return this._amountPaid;
2754
+ }
2755
+ get amountRemaining() {
2756
+ if (this._amountRemaining === void 0) throw new Error("amountRemaining is not defined");
2757
+ return this._amountRemaining;
2758
+ }
2759
+ get subtotal() {
2760
+ if (this._subtotal === void 0) throw new Error("subtotal is not defined");
2761
+ return this._subtotal;
2762
+ }
2763
+ get total() {
2764
+ if (this._total === void 0) throw new Error("total is not defined");
2765
+ return this._total;
2766
+ }
2767
+ get tax() {
2768
+ return this._tax;
2769
+ }
2770
+ get currency() {
2771
+ if (!this._currency) throw new Error("currency is not defined");
2772
+ return this._currency;
2773
+ }
2774
+ get periodStart() {
2775
+ if (!this._periodStart) throw new Error("periodStart is not defined");
2776
+ return this._periodStart;
2777
+ }
2778
+ get periodEnd() {
2779
+ if (!this._periodEnd) throw new Error("periodEnd is not defined");
2780
+ return this._periodEnd;
2781
+ }
2782
+ get dueDate() {
2783
+ return this._dueDate;
2784
+ }
2785
+ get paidAt() {
2786
+ return this._paidAt;
2787
+ }
2788
+ get attemptCount() {
2789
+ return this._attemptCount;
2790
+ }
2791
+ get attempted() {
2792
+ return this._attempted;
2793
+ }
2794
+ get stripeHostedInvoiceUrl() {
2795
+ return this._stripeHostedInvoiceUrl;
2796
+ }
2797
+ get stripePdfUrl() {
2798
+ return this._stripePdfUrl;
2799
+ }
2800
+ get paid() {
2801
+ return this._paid;
2802
+ }
2803
+ get metadata() {
2804
+ return this._metadata;
2805
+ }
2806
+ rehydrate(data) {
2807
+ super.rehydrate(data);
2808
+ this._stripeInvoiceId = data.jsonApi.attributes.stripeInvoiceId;
2809
+ this._stripeInvoiceNumber = data.jsonApi.attributes.stripeInvoiceNumber;
2810
+ this._customerId = data.jsonApi.attributes.customerId;
2811
+ this._subscriptionId = data.jsonApi.attributes.subscriptionId;
2812
+ this._status = data.jsonApi.attributes.status;
2813
+ this._amountDue = data.jsonApi.attributes.amountDue;
2814
+ this._amountPaid = data.jsonApi.attributes.amountPaid;
2815
+ this._amountRemaining = data.jsonApi.attributes.amountRemaining;
2816
+ this._subtotal = data.jsonApi.attributes.subtotal;
2817
+ this._total = data.jsonApi.attributes.total;
2818
+ this._tax = data.jsonApi.attributes.tax;
2819
+ this._currency = data.jsonApi.attributes.currency;
2820
+ this._periodStart = data.jsonApi.attributes.periodStart ? new Date(data.jsonApi.attributes.periodStart) : void 0;
2821
+ this._periodEnd = data.jsonApi.attributes.periodEnd ? new Date(data.jsonApi.attributes.periodEnd) : void 0;
2822
+ this._dueDate = data.jsonApi.attributes.dueDate ? new Date(data.jsonApi.attributes.dueDate) : void 0;
2823
+ this._paidAt = data.jsonApi.attributes.paidAt ? new Date(data.jsonApi.attributes.paidAt) : void 0;
2824
+ this._attemptCount = _nullishCoalesce(data.jsonApi.attributes.attemptCount, () => ( 0));
2825
+ this._attempted = _nullishCoalesce(data.jsonApi.attributes.attempted, () => ( false));
2826
+ this._stripeHostedInvoiceUrl = data.jsonApi.attributes.stripeHostedInvoiceUrl;
2827
+ this._stripePdfUrl = data.jsonApi.attributes.stripePdfUrl;
2828
+ this._paid = _nullishCoalesce(data.jsonApi.attributes.paid, () => ( false));
2829
+ this._metadata = data.jsonApi.attributes.metadata ? typeof data.jsonApi.attributes.metadata === "string" ? JSON.parse(data.jsonApi.attributes.metadata) : data.jsonApi.attributes.metadata : void 0;
2830
+ this._subscription = this._readIncluded(
2831
+ data,
2832
+ "subscription",
2833
+ Modules.StripeSubscription
2834
+ );
2835
+ return this;
2836
+ }
2837
+ createJsonApi(_data) {
2838
+ throw new Error("Invoice is managed by Stripe and cannot be created directly");
2839
+ }
2840
+ }, _class4);
2841
+
2842
+ // src/features/billing/stripe-invoice/data/stripe-invoice.interface.ts
2843
+ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
2844
+ InvoiceStatus2["DRAFT"] = "draft";
2845
+ InvoiceStatus2["OPEN"] = "open";
2846
+ InvoiceStatus2["PAID"] = "paid";
2847
+ InvoiceStatus2["UNCOLLECTIBLE"] = "uncollectible";
2848
+ InvoiceStatus2["VOID"] = "void";
2849
+ return InvoiceStatus2;
2850
+ })(InvoiceStatus || {});
2851
+
2852
+ // src/features/billing/stripe-invoice/data/stripe-invoice.service.ts
2853
+ var StripeInvoiceService = class extends AbstractService {
2854
+ static {
2855
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeInvoiceService");
2856
+ }
2857
+ /**
2858
+ * List all invoices for the current user
2859
+ */
2860
+ static async listInvoices(params) {
2861
+ const endpoint = new EndpointCreator({
2862
+ endpoint: Modules.StripeInvoice
2863
+ });
2864
+ if (_optionalChain([params, 'optionalAccess', _67 => _67.status])) {
2865
+ endpoint.addAdditionalParam("status", params.status);
2866
+ }
2867
+ return this.callApi({
2868
+ type: Modules.StripeInvoice,
2869
+ method: "GET" /* GET */,
2870
+ endpoint: endpoint.generate(),
2871
+ next: _optionalChain([params, 'optionalAccess', _68 => _68.next]),
2872
+ previous: _optionalChain([params, 'optionalAccess', _69 => _69.prev])
2873
+ });
2874
+ }
2875
+ /**
2876
+ * Get a specific invoice by ID
2877
+ */
2878
+ static async getInvoice(params) {
2879
+ const endpoint = new EndpointCreator({
2880
+ endpoint: Modules.StripeInvoice,
2881
+ id: params.invoiceId
2882
+ });
2883
+ return this.callApi({
2884
+ type: Modules.StripeInvoice,
2885
+ method: "GET" /* GET */,
2886
+ endpoint: endpoint.generate()
2887
+ });
2888
+ }
2889
+ /**
2890
+ * Get the upcoming invoice for the current user
2891
+ */
2892
+ static async getUpcomingInvoice() {
2893
+ const endpoint = new EndpointCreator({
2894
+ endpoint: Modules.StripeInvoice,
2895
+ id: "upcoming"
2896
+ });
2897
+ return this.callApi({
2898
+ type: Modules.StripeInvoice,
2899
+ method: "GET" /* GET */,
2900
+ endpoint: endpoint.generate()
2901
+ });
2902
+ }
2903
+ };
2904
+
2905
+ // src/features/billing/stripe-invoice/stripe-invoice.module.ts
2906
+ var StripeInvoiceModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
2907
+ name: "stripe-invoices",
2908
+ model: StripeInvoice,
2909
+ moduleId: "37c73b8b-d3b1-4e5e-8fcb-a66d8ecfc05b"
2910
+ }), "StripeInvoiceModule");
2911
+
2912
+ // src/features/billing/stripe-price/data/stripe-price.ts
2913
+ var StripePrice = (_class5 = class extends AbstractApiData {constructor(...args3) { super(...args3); _class5.prototype.__init5.call(this); }
2914
+ static {
2915
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripePrice");
2916
+ }
2917
+
2918
+
2919
+
2920
+ __init5() {this._active = true}
2921
+
2922
+
2923
+
2924
+
2925
+
2926
+
2927
+
2928
+
2929
+
2930
+ get stripePriceId() {
2931
+ if (!this._stripePriceId) throw new Error("stripePriceId is not defined");
2932
+ return this._stripePriceId;
2933
+ }
2934
+ get productId() {
2935
+ if (!this._productId) throw new Error("productId is not defined");
2936
+ return this._productId;
2937
+ }
2938
+ get product() {
2939
+ return this._product;
2940
+ }
2941
+ get active() {
2942
+ return this._active;
2943
+ }
2944
+ get currency() {
2945
+ if (!this._currency) throw new Error("currency is not defined");
2946
+ return this._currency;
2947
+ }
2948
+ get unitAmount() {
2949
+ return this._unitAmount;
2950
+ }
2951
+ get recurring() {
2952
+ return this._recurring;
2953
+ }
2954
+ get priceType() {
2955
+ if (!this._priceType) throw new Error("priceType is not defined");
2956
+ return this._priceType;
2957
+ }
2958
+ get nickname() {
2959
+ return this._nickname;
2960
+ }
2961
+ get lookupKey() {
2962
+ return this._lookupKey;
2963
+ }
2964
+ get metadata() {
2965
+ return this._metadata;
2966
+ }
2967
+ get description() {
2968
+ return this._description;
2969
+ }
2970
+ get features() {
2971
+ return this._features;
2972
+ }
2973
+ rehydrate(data) {
2974
+ super.rehydrate(data);
2975
+ this._stripePriceId = data.jsonApi.attributes.stripePriceId;
2976
+ this._productId = data.jsonApi.attributes.productId;
2977
+ this._active = _nullishCoalesce(data.jsonApi.attributes.active, () => ( true));
2978
+ this._currency = data.jsonApi.attributes.currency;
2979
+ this._unitAmount = data.jsonApi.attributes.unitAmount;
2980
+ this._priceType = data.jsonApi.attributes.priceType;
2981
+ if (data.jsonApi.attributes.recurringInterval) {
2982
+ this._recurring = {
2983
+ interval: data.jsonApi.attributes.recurringInterval,
2984
+ intervalCount: _nullishCoalesce(data.jsonApi.attributes.recurringIntervalCount, () => ( 1)),
2985
+ usageType: data.jsonApi.attributes.recurringUsageType
2986
+ };
2987
+ }
2988
+ this._nickname = data.jsonApi.attributes.nickname;
2989
+ this._lookupKey = data.jsonApi.attributes.lookupKey;
2990
+ this._metadata = data.jsonApi.attributes.metadata ? typeof data.jsonApi.attributes.metadata === "string" ? JSON.parse(data.jsonApi.attributes.metadata) : data.jsonApi.attributes.metadata : void 0;
2991
+ this._description = data.jsonApi.attributes.description;
2992
+ this._features = data.jsonApi.attributes.features ? typeof data.jsonApi.attributes.features === "string" ? JSON.parse(data.jsonApi.attributes.features) : data.jsonApi.attributes.features : void 0;
2993
+ this._product = this._readIncluded(data, "product", Modules.StripeProduct);
2994
+ return this;
2995
+ }
2996
+ createJsonApi(data) {
2997
+ const response = {
2998
+ data: {
2999
+ type: Modules.StripePrice.name,
3000
+ id: data.id,
3001
+ attributes: {}
3002
+ }
3003
+ };
3004
+ if ("productId" in data && data.productId) {
3005
+ response.data.attributes.productId = data.productId;
3006
+ }
3007
+ if ("currency" in data && data.currency) {
3008
+ response.data.attributes.currency = data.currency;
3009
+ }
3010
+ if ("unitAmount" in data && data.unitAmount !== void 0) {
3011
+ response.data.attributes.unitAmount = data.unitAmount;
3012
+ }
3013
+ if ("active" in data && data.active !== void 0) {
3014
+ response.data.attributes.active = data.active;
3015
+ }
3016
+ if ("nickname" in data && data.nickname !== void 0) {
3017
+ response.data.attributes.nickname = data.nickname;
3018
+ }
3019
+ if ("metadata" in data && data.metadata) {
3020
+ response.data.attributes.metadata = data.metadata;
3021
+ }
3022
+ if ("recurring" in data && data.recurring) {
3023
+ response.data.attributes.recurring = data.recurring;
3024
+ }
3025
+ if ("description" in data && data.description !== void 0) {
3026
+ response.data.attributes.description = data.description;
3027
+ }
3028
+ if ("features" in data && data.features !== void 0) {
3029
+ response.data.attributes.features = JSON.stringify(data.features);
3030
+ }
3031
+ return response;
3032
+ }
3033
+ }, _class5);
3034
+
3035
+ // src/features/billing/stripe-price/data/stripe-price.service.ts
3036
+ var StripePriceService = class extends AbstractService {
3037
+ static {
3038
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripePriceService");
3039
+ }
3040
+ /**
3041
+ * List all prices (admin)
3042
+ */
3043
+ static async listPrices(params) {
3044
+ const endpoint = new EndpointCreator({
3045
+ endpoint: Modules.StripePrice
3046
+ });
3047
+ if (_optionalChain([params, 'optionalAccess', _70 => _70.productId])) {
3048
+ endpoint.addAdditionalParam("productId", params.productId);
3049
+ }
3050
+ if (_optionalChain([params, 'optionalAccess', _71 => _71.active]) !== void 0) {
3051
+ endpoint.addAdditionalParam("active", params.active.toString());
3052
+ }
3053
+ return this.callApi({
3054
+ type: Modules.StripePrice,
3055
+ method: "GET" /* GET */,
3056
+ endpoint: endpoint.generate(),
3057
+ next: _optionalChain([params, 'optionalAccess', _72 => _72.next]),
3058
+ previous: _optionalChain([params, 'optionalAccess', _73 => _73.prev])
3059
+ });
3060
+ }
3061
+ /**
3062
+ * Get a specific price by ID (admin)
3063
+ */
3064
+ static async getPrice(params) {
3065
+ const endpoint = new EndpointCreator({
3066
+ endpoint: Modules.StripePrice,
3067
+ id: params.id
3068
+ });
3069
+ return this.callApi({
3070
+ type: Modules.StripePrice,
3071
+ method: "GET" /* GET */,
3072
+ endpoint: endpoint.generate()
3073
+ });
3074
+ }
3075
+ /**
3076
+ * Create a new price (admin)
3077
+ */
3078
+ static async createPrice(params) {
3079
+ const endpoint = new EndpointCreator({
3080
+ endpoint: Modules.StripePrice
3081
+ });
3082
+ return this.callApi({
3083
+ type: Modules.StripePrice,
3084
+ method: "POST" /* POST */,
3085
+ endpoint: endpoint.generate(),
3086
+ input: params
3087
+ });
3088
+ }
3089
+ /**
3090
+ * Update an existing price (admin)
3091
+ */
3092
+ static async updatePrice(params) {
3093
+ const endpoint = new EndpointCreator({
3094
+ endpoint: Modules.StripePrice,
3095
+ id: params.id
3096
+ });
3097
+ return this.callApi({
3098
+ type: Modules.StripePrice,
3099
+ method: "PUT" /* PUT */,
3100
+ endpoint: endpoint.generate(),
3101
+ input: params
3102
+ });
3103
+ }
3104
+ /**
3105
+ * Archive a price (admin)
3106
+ *
3107
+ * Sets the price as inactive. Archived prices cannot be used for new subscriptions.
3108
+ */
3109
+ static async archivePrice(params) {
3110
+ const endpoint = new EndpointCreator({
3111
+ endpoint: Modules.StripePrice,
3112
+ id: params.id,
3113
+ childEndpoint: "archive"
3114
+ });
3115
+ await this.callApi({
3116
+ type: Modules.StripePrice,
3117
+ method: "POST" /* POST */,
3118
+ endpoint: endpoint.generate()
3119
+ });
3120
+ }
3121
+ /**
3122
+ * Reactivate a price (admin)
3123
+ *
3124
+ * Sets the price as active. Active prices can be used for new subscriptions.
3125
+ */
3126
+ static async reactivatePrice(params) {
3127
+ const endpoint = new EndpointCreator({
3128
+ endpoint: Modules.StripePrice,
3129
+ id: params.id,
3130
+ childEndpoint: "archive"
3131
+ });
3132
+ await this.callApi({
3133
+ type: Modules.StripePrice,
3134
+ method: "DELETE" /* DELETE */,
3135
+ endpoint: endpoint.generate()
3136
+ });
3137
+ }
3138
+ };
3139
+
3140
+ // src/features/billing/stripe-price/stripe-price.module.ts
3141
+ var StripePriceModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
3142
+ name: "stripe-prices",
3143
+ model: StripePrice,
3144
+ moduleId: "a7d3e5f1-8c9b-4a2e-b6d7-3f1c8e9a4b5d"
3145
+ }), "StripePriceModule");
3146
+
3147
+ // src/features/billing/stripe-product/data/stripe-product.ts
3148
+ var StripeProduct = (_class6 = class extends AbstractApiData {constructor(...args4) { super(...args4); _class6.prototype.__init6.call(this);_class6.prototype.__init7.call(this); }
3149
+ static {
3150
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeProduct");
3151
+ }
3152
+
3153
+
3154
+
3155
+ __init6() {this._active = true}
3156
+
3157
+ __init7() {this._stripePrices = []}
3158
+ get stripeProductId() {
3159
+ if (!this._stripeProductId) throw new Error("stripeProductId is not defined");
3160
+ return this._stripeProductId;
3161
+ }
3162
+ get name() {
3163
+ if (!this._name) throw new Error("name is not defined");
3164
+ return this._name;
3165
+ }
3166
+ get description() {
3167
+ return this._description;
3168
+ }
3169
+ get active() {
3170
+ return this._active;
3171
+ }
3172
+ get metadata() {
3173
+ return this._metadata;
3174
+ }
3175
+ get stripePrices() {
3176
+ return _nullishCoalesce(this._stripePrices, () => ( []));
3177
+ }
3178
+ rehydrate(data) {
3179
+ super.rehydrate(data);
3180
+ this._stripeProductId = data.jsonApi.attributes.stripeProductId;
3181
+ this._name = data.jsonApi.attributes.name;
3182
+ this._description = data.jsonApi.attributes.description;
3183
+ this._active = _nullishCoalesce(data.jsonApi.attributes.active, () => ( true));
3184
+ this._metadata = data.jsonApi.attributes.metadata ? typeof data.jsonApi.attributes.metadata === "string" ? JSON.parse(data.jsonApi.attributes.metadata) : data.jsonApi.attributes.metadata : void 0;
3185
+ this._stripePrices = this._readIncluded(data, "stripePrices", Modules.StripePrice);
3186
+ return this;
3187
+ }
3188
+ createJsonApi(data) {
3189
+ const response = {
3190
+ data: {
3191
+ type: Modules.StripeProduct.name,
3192
+ id: data.id,
3193
+ attributes: {}
3194
+ }
3195
+ };
3196
+ if (data.name) response.data.attributes.name = data.name;
3197
+ if (data.description !== void 0) response.data.attributes.description = data.description;
3198
+ if (data.active !== void 0) response.data.attributes.active = data.active;
3199
+ if (data.metadata) response.data.attributes.metadata = data.metadata;
3200
+ return response;
3201
+ }
3202
+ }, _class6);
3203
+
3204
+ // src/features/billing/stripe-product/data/stripe-product.service.ts
3205
+ var StripeProductService = class extends AbstractService {
3206
+ static {
3207
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeProductService");
3208
+ }
3209
+ /**
3210
+ * List all products (admin)
3211
+ */
3212
+ static async listProducts(params) {
3213
+ const endpoint = new EndpointCreator({
3214
+ endpoint: Modules.StripeProduct
3215
+ });
3216
+ if (_optionalChain([params, 'optionalAccess', _74 => _74.active]) !== void 0) {
3217
+ endpoint.addAdditionalParam("active", params.active.toString());
3218
+ }
3219
+ return this.callApi({
3220
+ type: Modules.StripeProduct,
3221
+ method: "GET" /* GET */,
3222
+ endpoint: endpoint.generate(),
3223
+ next: _optionalChain([params, 'optionalAccess', _75 => _75.next]),
3224
+ previous: _optionalChain([params, 'optionalAccess', _76 => _76.prev])
3225
+ });
3226
+ }
3227
+ /**
3228
+ * Get a specific product by ID (admin)
3229
+ */
3230
+ static async getProduct(params) {
3231
+ const endpoint = new EndpointCreator({
3232
+ endpoint: Modules.StripeProduct,
3233
+ id: params.id
3234
+ });
3235
+ return this.callApi({
3236
+ type: Modules.StripeProduct,
3237
+ method: "GET" /* GET */,
3238
+ endpoint: endpoint.generate()
3239
+ });
3240
+ }
3241
+ /**
3242
+ * Create a new product (admin)
3243
+ */
3244
+ static async createProduct(params) {
3245
+ const endpoint = new EndpointCreator({
3246
+ endpoint: Modules.StripeProduct
3247
+ });
3248
+ return this.callApi({
3249
+ type: Modules.StripeProduct,
3250
+ method: "POST" /* POST */,
3251
+ endpoint: endpoint.generate(),
3252
+ input: params
3253
+ });
3254
+ }
3255
+ /**
3256
+ * Update an existing product (admin)
3257
+ */
3258
+ static async updateProduct(params) {
3259
+ const endpoint = new EndpointCreator({
3260
+ endpoint: Modules.StripeProduct,
3261
+ id: params.id
3262
+ });
3263
+ return this.callApi({
3264
+ type: Modules.StripeProduct,
3265
+ method: "PUT" /* PUT */,
3266
+ endpoint: endpoint.generate(),
3267
+ input: params
3268
+ });
3269
+ }
3270
+ /**
3271
+ * Archive a product (admin)
3272
+ */
3273
+ static async archiveProduct(params) {
3274
+ const endpoint = new EndpointCreator({
3275
+ endpoint: Modules.StripeProduct,
3276
+ id: params.id,
3277
+ childEndpoint: "archive"
3278
+ });
3279
+ return this.callApi({
3280
+ type: Modules.StripeProduct,
3281
+ method: "POST" /* POST */,
3282
+ endpoint: endpoint.generate()
3283
+ });
3284
+ }
3285
+ /**
3286
+ * Reactivate a product (admin) - sets active to true
3287
+ */
3288
+ static async reactivateProduct(params) {
3289
+ const endpoint = new EndpointCreator({
3290
+ endpoint: Modules.StripeProduct,
3291
+ id: params.id,
3292
+ childEndpoint: "archive"
3293
+ });
3294
+ return this.callApi({
3295
+ type: Modules.StripeProduct,
3296
+ method: "DELETE" /* DELETE */,
3297
+ endpoint: endpoint.generate()
3298
+ });
3299
+ }
3300
+ };
3301
+
3302
+ // src/features/billing/stripe-product/stripe-product.module.ts
3303
+ var StripeProductModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
3304
+ name: "stripe-products",
3305
+ model: StripeProduct,
3306
+ moduleId: "f8c4a1e9-3b2d-4f7a-9e5c-1d8a6b3c9f2e"
3307
+ }), "StripeProductModule");
3308
+
3309
+ // src/features/billing/stripe-subscription/data/stripe-subscription.ts
3310
+ var StripeSubscription = (_class7 = class extends AbstractApiData {constructor(...args5) { super(...args5); _class7.prototype.__init8.call(this); }
3311
+ static {
3312
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeSubscription");
3313
+ }
3314
+
3315
+
3316
+
3317
+
3318
+ __init8() {this._cancelAtPeriodEnd = false}
3319
+
3320
+
3321
+
3322
+
3323
+ get stripeSubscriptionId() {
3324
+ if (!this._stripeSubscriptionId) throw new Error("stripeSubscriptionId is not defined");
3325
+ return this._stripeSubscriptionId;
3326
+ }
3327
+ get status() {
3328
+ if (!this._status) throw new Error("status is not defined");
3329
+ return this._status;
3330
+ }
3331
+ get currentPeriodStart() {
3332
+ if (!this._currentPeriodStart) throw new Error("currentPeriodStart is not defined");
3333
+ return this._currentPeriodStart;
3334
+ }
3335
+ get currentPeriodEnd() {
3336
+ if (!this._currentPeriodEnd) throw new Error("currentPeriodEnd is not defined");
3337
+ return this._currentPeriodEnd;
3338
+ }
3339
+ get cancelAtPeriodEnd() {
3340
+ return this._cancelAtPeriodEnd;
3341
+ }
3342
+ get canceledAt() {
3343
+ return this._canceledAt;
3344
+ }
3345
+ get trialStart() {
3346
+ return this._trialStart;
3347
+ }
3348
+ get trialEnd() {
3349
+ return this._trialEnd;
3350
+ }
3351
+ get price() {
3352
+ return this._price;
3353
+ }
3354
+ rehydrate(data) {
3355
+ super.rehydrate(data);
3356
+ this._stripeSubscriptionId = data.jsonApi.attributes.stripeSubscriptionId;
3357
+ this._status = data.jsonApi.attributes.status;
3358
+ this._currentPeriodStart = data.jsonApi.attributes.currentPeriodStart ? new Date(data.jsonApi.attributes.currentPeriodStart) : void 0;
3359
+ this._currentPeriodEnd = data.jsonApi.attributes.currentPeriodEnd ? new Date(data.jsonApi.attributes.currentPeriodEnd) : void 0;
3360
+ this._cancelAtPeriodEnd = _nullishCoalesce(data.jsonApi.attributes.cancelAtPeriodEnd, () => ( false));
3361
+ this._canceledAt = data.jsonApi.attributes.canceledAt ? new Date(data.jsonApi.attributes.canceledAt) : void 0;
3362
+ this._trialStart = data.jsonApi.attributes.trialStart ? new Date(data.jsonApi.attributes.trialStart) : void 0;
3363
+ this._trialEnd = data.jsonApi.attributes.trialEnd ? new Date(data.jsonApi.attributes.trialEnd) : void 0;
3364
+ this._price = this._readIncluded(data, "price", Modules.StripePrice);
3365
+ return this;
3366
+ }
3367
+ createJsonApi(data) {
3368
+ const response = {
3369
+ data: {
3370
+ type: Modules.StripeSubscription.name,
3371
+ id: data.id,
3372
+ attributes: {}
3373
+ }
3374
+ };
3375
+ if (data.priceId) {
3376
+ response.data.relationships = {
3377
+ stripePrice: {
3378
+ data: {
3379
+ type: Modules.StripePrice.name,
3380
+ id: data.priceId
3381
+ }
3382
+ }
3383
+ };
3384
+ }
3385
+ if (data.newPriceId) {
3386
+ response.data.attributes.priceId = data.newPriceId;
3387
+ }
3388
+ if (data.cancelImmediately !== void 0) {
3389
+ response.data.attributes.cancelImmediately = data.cancelImmediately;
3390
+ }
3391
+ if (data.quantity !== void 0) {
3392
+ response.data.attributes.quantity = data.quantity;
3393
+ }
3394
+ if (data.trialPeriodDays !== void 0) {
3395
+ response.data.attributes.trialPeriodDays = data.trialPeriodDays;
3396
+ }
3397
+ if (data.paymentMethodId) {
3398
+ response.data.attributes.paymentMethodId = data.paymentMethodId;
3399
+ }
3400
+ if (data.metadata) {
3401
+ response.data.attributes.metadata = data.metadata;
3402
+ }
3403
+ return response;
3404
+ }
3405
+ }, _class7);
3406
+
3407
+ // src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts
3408
+ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
3409
+ SubscriptionStatus2["ACTIVE"] = "active";
3410
+ SubscriptionStatus2["PAST_DUE"] = "past_due";
3411
+ SubscriptionStatus2["UNPAID"] = "unpaid";
3412
+ SubscriptionStatus2["CANCELED"] = "canceled";
3413
+ SubscriptionStatus2["INCOMPLETE"] = "incomplete";
3414
+ SubscriptionStatus2["INCOMPLETE_EXPIRED"] = "incomplete_expired";
3415
+ SubscriptionStatus2["TRIALING"] = "trialing";
3416
+ SubscriptionStatus2["PAUSED"] = "paused";
3417
+ return SubscriptionStatus2;
3418
+ })(SubscriptionStatus || {});
3419
+
3420
+ // src/features/billing/stripe-subscription/data/stripe-subscription.service.ts
3421
+ var StripeSubscriptionService = class extends AbstractService {
3422
+ static {
3423
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeSubscriptionService");
3424
+ }
3425
+ // ============================================================================
3426
+ // Subscription Methods
3427
+ // ============================================================================
3428
+ /**
3429
+ * List all subscriptions for the current user
3430
+ */
3431
+ static async listSubscriptions(params) {
3432
+ const endpoint = new EndpointCreator({
3433
+ endpoint: Modules.StripeSubscription
3434
+ });
3435
+ return this.callApi({
3436
+ type: Modules.StripeSubscription,
3437
+ method: "GET" /* GET */,
3438
+ endpoint: endpoint.generate(),
3439
+ next: _optionalChain([params, 'optionalAccess', _77 => _77.next]),
3440
+ previous: _optionalChain([params, 'optionalAccess', _78 => _78.prev])
3441
+ });
3442
+ }
3443
+ /**
3444
+ * Get a specific subscription by ID
3445
+ */
3446
+ static async getSubscription(params) {
3447
+ const endpoint = new EndpointCreator({
3448
+ endpoint: Modules.StripeSubscription,
3449
+ id: params.subscriptionId
3450
+ });
3451
+ return this.callApi({
3452
+ type: Modules.StripeSubscription,
3453
+ method: "GET" /* GET */,
3454
+ endpoint: endpoint.generate()
3455
+ });
3456
+ }
3457
+ /**
3458
+ * Create a new subscription
3459
+ * Returns subscription data along with meta containing SCA payment confirmation details
3460
+ */
3461
+ static async createSubscription(params) {
3462
+ const endpoint = new EndpointCreator({
3463
+ endpoint: Modules.StripeSubscription
3464
+ });
3465
+ const result = await this.callApiWithMeta({
3466
+ type: Modules.StripeSubscription,
3467
+ method: "POST" /* POST */,
3468
+ endpoint: endpoint.generate(),
3469
+ input: params
3470
+ });
3471
+ return {
3472
+ subscription: result.data,
3473
+ meta: _nullishCoalesce(result.meta, () => ( {
3474
+ clientSecret: null,
3475
+ paymentIntentId: null,
3476
+ requiresAction: false
3477
+ }))
3478
+ };
3479
+ }
3480
+ /**
3481
+ * Change the plan of an existing subscription
3482
+ */
3483
+ static async changePlan(params) {
3484
+ const endpoint = new EndpointCreator({
3485
+ endpoint: Modules.StripeSubscription,
3486
+ id: params.id,
3487
+ childEndpoint: "change-plan"
3488
+ });
3489
+ return this.callApi({
3490
+ type: Modules.StripeSubscription,
3491
+ method: "PUT" /* PUT */,
3492
+ endpoint: endpoint.generate(),
3493
+ input: params
3494
+ });
3495
+ }
3496
+ /**
3497
+ * Get a proration preview for a plan change
3498
+ */
3499
+ static async getProrationPreview(params) {
3500
+ const endpoint = new EndpointCreator({
3501
+ endpoint: Modules.StripeSubscription,
3502
+ id: params.subscriptionId,
3503
+ childEndpoint: "proration-preview"
3504
+ });
3505
+ endpoint.addAdditionalParam("newPriceId", params.newPriceId);
3506
+ if (params.quantity) {
3507
+ endpoint.addAdditionalParam("quantity", params.quantity.toString());
3508
+ }
3509
+ return this.callApi({
3510
+ type: Modules.StripeSubscription,
3511
+ method: "GET" /* GET */,
3512
+ endpoint: endpoint.generate()
3513
+ });
3514
+ }
3515
+ /**
3516
+ * Cancel a subscription
3517
+ */
3518
+ static async cancelSubscription(params) {
3519
+ const endpoint = new EndpointCreator({
3520
+ endpoint: Modules.StripeSubscription,
3521
+ id: params.id,
3522
+ childEndpoint: "cancel"
3523
+ });
3524
+ return this.callApi({
3525
+ type: Modules.StripeSubscription,
3526
+ method: "POST" /* POST */,
3527
+ endpoint: endpoint.generate(),
3528
+ input: params
3529
+ });
3530
+ }
3531
+ /**
3532
+ * Pause a subscription
3533
+ */
3534
+ static async pauseSubscription(params) {
3535
+ const endpoint = new EndpointCreator({
3536
+ endpoint: Modules.StripeSubscription,
3537
+ id: params.subscriptionId,
3538
+ childEndpoint: "pause"
3539
+ });
3540
+ return this.callApi({
3541
+ type: Modules.StripeSubscription,
3542
+ method: "POST" /* POST */,
3543
+ endpoint: endpoint.generate()
3544
+ });
3545
+ }
3546
+ /**
3547
+ * Resume a paused subscription
3548
+ */
3549
+ static async resumeSubscription(params) {
3550
+ const endpoint = new EndpointCreator({
3551
+ endpoint: Modules.StripeSubscription,
3552
+ id: params.subscriptionId,
3553
+ childEndpoint: "resume"
3554
+ });
3555
+ return this.callApi({
3556
+ type: Modules.StripeSubscription,
3557
+ method: "POST" /* POST */,
3558
+ endpoint: endpoint.generate()
3559
+ });
3560
+ }
3561
+ /**
3562
+ * Sync a subscription with the latest data from Stripe
3563
+ * This is useful after payment confirmation to get the updated status
3564
+ */
3565
+ static async syncSubscription(params) {
3566
+ const endpoint = new EndpointCreator({
3567
+ endpoint: Modules.StripeSubscription,
3568
+ id: params.subscriptionId,
3569
+ childEndpoint: "sync"
3570
+ });
3571
+ return this.callApi({
3572
+ type: Modules.StripeSubscription,
3573
+ method: "POST" /* POST */,
3574
+ endpoint: endpoint.generate()
3575
+ });
3576
+ }
3577
+ };
3578
+
3579
+ // src/features/billing/stripe-subscription/stripe-subscription.module.ts
3580
+ var StripeSubscriptionModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
3581
+ name: "stripe-subscriptions",
3582
+ model: StripeSubscription,
3583
+ moduleId: "5e8797ef-650b-4dd5-ac79-a2e530a6c7ba"
3584
+ }), "StripeSubscriptionModule");
3585
+
3586
+ // src/features/billing/stripe-usage/data/stripe-usage.ts
3587
+ var StripeUsage = class extends AbstractApiData {
3588
+ static {
3589
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeUsage");
3590
+ }
3591
+
3592
+
3593
+
3594
+
3595
+
3596
+
3597
+ get subscriptionId() {
3598
+ if (!this._subscriptionId) throw new Error("subscriptionId is not defined");
3599
+ return this._subscriptionId;
3600
+ }
3601
+ get meterId() {
3602
+ if (!this._meterId) throw new Error("meterId is not defined");
3603
+ return this._meterId;
3604
+ }
3605
+ get meterEventName() {
3606
+ if (!this._meterEventName) throw new Error("meterEventName is not defined");
3607
+ return this._meterEventName;
3608
+ }
3609
+ get stripeEventId() {
3610
+ if (!this._stripeEventId) throw new Error("stripeEventId is not defined");
3611
+ return this._stripeEventId;
3612
+ }
3613
+ get quantity() {
3614
+ if (this._quantity === void 0) throw new Error("quantity is not defined");
3615
+ return this._quantity;
3616
+ }
3617
+ get timestamp() {
3618
+ return this._timestamp;
3619
+ }
3620
+ rehydrate(data) {
3621
+ super.rehydrate(data);
3622
+ this._subscriptionId = data.jsonApi.attributes.subscriptionId;
3623
+ this._meterId = data.jsonApi.attributes.meterId;
3624
+ this._meterEventName = data.jsonApi.attributes.meterEventName;
3625
+ this._stripeEventId = data.jsonApi.attributes.stripeEventId;
3626
+ this._quantity = data.jsonApi.attributes.quantity;
3627
+ this._timestamp = data.jsonApi.attributes.timestamp ? new Date(data.jsonApi.attributes.timestamp) : void 0;
3628
+ return this;
3629
+ }
3630
+ createJsonApi(data) {
3631
+ const response = {
3632
+ data: {
3633
+ type: Modules.StripeUsage.name,
3634
+ attributes: {
3635
+ subscriptionItemId: data.subscriptionItemId,
3636
+ quantity: data.quantity
3637
+ }
3638
+ }
3639
+ };
3640
+ if (data.timestamp !== void 0) response.data.attributes.timestamp = data.timestamp;
3641
+ if (data.action !== void 0) response.data.attributes.action = data.action;
3642
+ return response;
3643
+ }
3644
+ };
3645
+
3646
+ // src/features/billing/stripe-usage/data/stripe-usage.service.ts
3647
+ var StripeUsageService = class extends AbstractService {
3648
+ static {
3649
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "StripeUsageService");
3650
+ }
3651
+ // ============================================================================
3652
+ // Meter Methods
3653
+ // ============================================================================
3654
+ /**
3655
+ * List all available usage meters
3656
+ */
3657
+ static async listMeters(params) {
3658
+ const endpoint = new EndpointCreator({
3659
+ endpoint: Modules.StripeUsage,
3660
+ childEndpoint: "meters"
3661
+ });
3662
+ return this.callApi({
3663
+ type: Modules.StripeUsage,
3664
+ method: "GET" /* GET */,
3665
+ endpoint: endpoint.generate(),
3666
+ next: _optionalChain([params, 'optionalAccess', _79 => _79.next]),
3667
+ previous: _optionalChain([params, 'optionalAccess', _80 => _80.prev])
3668
+ });
3669
+ }
3670
+ /**
3671
+ * Get meter summaries for a specific time period
3672
+ */
3673
+ static async getMeterSummaries(params) {
3674
+ const endpoint = new EndpointCreator({
3675
+ endpoint: Modules.StripeUsage,
3676
+ childEndpoint: `meters/${params.meterId}/summaries`
3677
+ });
3678
+ endpoint.addAdditionalParam("startTime", params.startTime.toISOString());
3679
+ endpoint.addAdditionalParam("endTime", params.endTime.toISOString());
3680
+ return this.callApi({
3681
+ type: Modules.StripeUsage,
3682
+ method: "GET" /* GET */,
3683
+ endpoint: endpoint.generate()
3684
+ });
3685
+ }
3686
+ // ============================================================================
3687
+ // Usage Record Methods
3688
+ // ============================================================================
3689
+ /**
3690
+ * Report usage for a subscription item
3691
+ */
3692
+ static async reportUsage(params) {
3693
+ const endpoint = new EndpointCreator({
3694
+ endpoint: Modules.StripeUsage
3695
+ });
3696
+ return this.callApi({
3697
+ type: Modules.StripeUsage,
3698
+ method: "POST" /* POST */,
3699
+ endpoint: endpoint.generate(),
3700
+ input: params
3701
+ });
3702
+ }
3703
+ /**
3704
+ * List usage records for a subscription item
3705
+ */
3706
+ static async listUsageRecords(params) {
3707
+ const endpoint = new EndpointCreator({
3708
+ endpoint: Modules.StripeUsage
3709
+ });
3710
+ endpoint.addAdditionalParam("subscriptionItemId", params.subscriptionItemId);
3711
+ return this.callApi({
3712
+ type: Modules.StripeUsage,
3713
+ method: "GET" /* GET */,
3714
+ endpoint: endpoint.generate(),
3715
+ next: _optionalChain([params, 'optionalAccess', _81 => _81.next]),
3716
+ previous: _optionalChain([params, 'optionalAccess', _82 => _82.prev])
3717
+ });
3718
+ }
3719
+ /**
3720
+ * Get usage summary for a subscription item
3721
+ */
3722
+ static async getUsageSummary(params) {
3723
+ const endpoint = new EndpointCreator({
3724
+ endpoint: Modules.StripeUsage,
3725
+ childEndpoint: "summary"
3726
+ });
3727
+ endpoint.addAdditionalParam("subscriptionItemId", params.subscriptionItemId);
3728
+ if (params.start) {
3729
+ endpoint.addAdditionalParam("start", params.start.toISOString());
3730
+ }
3731
+ if (params.end) {
3732
+ endpoint.addAdditionalParam("end", params.end.toISOString());
3733
+ }
3734
+ return this.callApi({
3735
+ type: Modules.StripeUsage,
3736
+ method: "GET" /* GET */,
3737
+ endpoint: endpoint.generate()
3738
+ });
3739
+ }
3740
+ };
3741
+
3742
+ // src/features/billing/stripe-usage/stripe-usage.module.ts
3743
+ var StripeUsageModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
3744
+ name: "stripe-usage-records",
3745
+ model: StripeUsage,
3746
+ moduleId: "c2e9f4a6-1d7b-4e3a-8f5c-9b2d6a1e7f3c"
3747
+ }), "StripeUsageModule");
3748
+
3749
+ // src/features/company/data/company.ts
3750
+ var Company = class extends AbstractApiData {
3751
+ static {
3752
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Company");
3753
+ }
3754
+
3755
+
3756
+
3757
+
3758
+
3759
+
3760
+
3761
+ get name() {
3762
+ if (this._name === void 0) throw new Error("Name is not defined");
3763
+ return this._name;
3764
+ }
3765
+ get logo() {
3766
+ return this._logo;
3767
+ }
3768
+ get logoUrl() {
3769
+ return this._logoUrl;
3770
+ }
3771
+ get licenseExpirationDate() {
3772
+ return this._licenseExpirationDate;
3773
+ }
3774
+ get features() {
3775
+ return _nullishCoalesce(this._features, () => ( []));
3776
+ }
3777
+ get modules() {
3778
+ return _nullishCoalesce(this._modules, () => ( []));
3779
+ }
3780
+ get configurations() {
3781
+ return this._configurations;
3782
+ }
3783
+ rehydrate(data) {
3784
+ super.rehydrate(data);
3785
+ this._name = data.jsonApi.attributes.name;
3786
+ this._configurations = data.jsonApi.attributes.configurations ? JSON.parse(data.jsonApi.attributes.configurations) : void 0;
3787
+ this._logo = data.jsonApi.attributes.logo;
3788
+ this._logoUrl = data.jsonApi.attributes.logoUrl;
3789
+ this._licenseExpirationDate = data.jsonApi.attributes.licenseExpirationDate ? new Date(data.jsonApi.attributes.licenseExpirationDate) : void 0;
3790
+ this._features = this._readIncluded(data, "features", Modules.Feature);
3791
+ this._modules = this._readIncluded(data, "modules", Modules.Module);
3792
+ return this;
3793
+ }
3794
+ createJsonApi(data) {
3795
+ const response = {
3796
+ data: {
3797
+ type: Modules.Company.name,
3798
+ id: data.id,
3799
+ attributes: {},
3800
+ meta: {},
3801
+ relationships: {}
3802
+ },
3803
+ included: []
3804
+ };
3805
+ if (data.name) response.data.attributes.name = data.name;
3806
+ if (data.configurations) response.data.attributes.configurations = JSON.stringify(data.configurations);
3807
+ if (data.logo) response.data.attributes.logo = data.logo;
3808
+ if (data.license) response.data.attributes.license = data.license;
3809
+ if (data.privateKey) response.data.attributes.privateKey = data.privateKey;
3810
+ if (data.featureIds && data.featureIds.length > 0) {
3811
+ response.data.relationships.features = {
3812
+ data: data.featureIds.map((featureId) => ({
3813
+ type: Modules.Feature.name,
3814
+ id: featureId
3815
+ }))
3816
+ };
3817
+ }
3818
+ if (data.moduleIds && data.moduleIds.length > 0) {
3819
+ response.data.relationships.modules = {
3820
+ data: data.moduleIds.map((moduleId) => ({
3821
+ type: Modules.Module.name,
3822
+ id: moduleId
3823
+ }))
3824
+ };
3825
+ }
3826
+ return response;
3827
+ }
3828
+ };
3829
+
3830
+ // src/features/company/data/company.fields.ts
3831
+ var CompanyFields = /* @__PURE__ */ ((CompanyFields2) => {
3832
+ CompanyFields2["companyId"] = "companyId";
3833
+ CompanyFields2["name"] = "name";
3834
+ CompanyFields2["createdAt"] = "createdAt";
3835
+ CompanyFields2["updatedAt"] = "updatedAt";
3836
+ return CompanyFields2;
3837
+ })(CompanyFields || {});
3838
+
3839
+ // src/features/company/data/company.service.ts
3840
+ var CompanyService = class extends AbstractService {
3841
+ static {
3842
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "CompanyService");
3843
+ }
3844
+ static async findOne(params) {
3845
+ return this.callApi({
3846
+ type: Modules.Company,
3847
+ method: "GET" /* GET */,
3848
+ endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.companyId }).generate()
3849
+ });
3850
+ }
3851
+ static async findMany(params) {
3852
+ const endpoint = new EndpointCreator({ endpoint: Modules.Company });
3853
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
3854
+ return this.callApi({
3855
+ type: Modules.Company,
3856
+ method: "GET" /* GET */,
3857
+ endpoint: endpoint.generate(),
3858
+ next: params.next
3859
+ });
3860
+ }
3861
+ static async delete(params) {
3862
+ await this.callApi({
2424
3863
  type: Modules.Company,
2425
3864
  method: "DELETE" /* DELETE */,
2426
3865
  endpoint: new EndpointCreator({ endpoint: Modules.Company, id: params.companyId }).generate()
@@ -2564,8 +4003,8 @@ var ContentService = class extends AbstractService {
2564
4003
  if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
2565
4004
  if (params.search) endpoint.addAdditionalParam("search", params.search);
2566
4005
  }
2567
- if (_optionalChain([Modules, 'access', _63 => _63.Content, 'access', _64 => _64.inclusions, 'optionalAccess', _65 => _65.lists, 'optionalAccess', _66 => _66.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2568
- if (_optionalChain([Modules, 'access', _67 => _67.Content, 'access', _68 => _68.inclusions, 'optionalAccess', _69 => _69.lists, 'optionalAccess', _70 => _70.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
4006
+ if (_optionalChain([Modules, 'access', _83 => _83.Content, 'access', _84 => _84.inclusions, 'optionalAccess', _85 => _85.lists, 'optionalAccess', _86 => _86.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
4007
+ if (_optionalChain([Modules, 'access', _87 => _87.Content, 'access', _88 => _88.inclusions, 'optionalAccess', _89 => _89.lists, 'optionalAccess', _90 => _90.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2569
4008
  return this.callApi({
2570
4009
  type: Modules.Content,
2571
4010
  method: "GET" /* GET */,
@@ -2579,8 +4018,8 @@ var ContentService = class extends AbstractService {
2579
4018
  id: params.id,
2580
4019
  childEndpoint: "relevance"
2581
4020
  });
2582
- if (_optionalChain([Modules, 'access', _71 => _71.Content, 'access', _72 => _72.inclusions, 'optionalAccess', _73 => _73.lists, 'optionalAccess', _74 => _74.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2583
- if (_optionalChain([Modules, 'access', _75 => _75.Content, 'access', _76 => _76.inclusions, 'optionalAccess', _77 => _77.lists, 'optionalAccess', _78 => _78.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
4021
+ if (_optionalChain([Modules, 'access', _91 => _91.Content, 'access', _92 => _92.inclusions, 'optionalAccess', _93 => _93.lists, 'optionalAccess', _94 => _94.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
4022
+ if (_optionalChain([Modules, 'access', _95 => _95.Content, 'access', _96 => _96.inclusions, 'optionalAccess', _97 => _97.lists, 'optionalAccess', _98 => _98.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2584
4023
  return this.callApi({
2585
4024
  type: Modules.Content,
2586
4025
  method: "GET" /* GET */,
@@ -2596,8 +4035,8 @@ var ContentService = class extends AbstractService {
2596
4035
  });
2597
4036
  if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
2598
4037
  if (params.search) endpoint.addAdditionalParam("search", params.search);
2599
- if (_optionalChain([Modules, 'access', _79 => _79.Content, 'access', _80 => _80.inclusions, 'optionalAccess', _81 => _81.lists, 'optionalAccess', _82 => _82.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
2600
- if (_optionalChain([Modules, 'access', _83 => _83.Content, 'access', _84 => _84.inclusions, 'optionalAccess', _85 => _85.lists, 'optionalAccess', _86 => _86.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
4038
+ if (_optionalChain([Modules, 'access', _99 => _99.Content, 'access', _100 => _100.inclusions, 'optionalAccess', _101 => _101.lists, 'optionalAccess', _102 => _102.fields])) endpoint.limitToFields(Modules.Content.inclusions.lists.fields);
4039
+ if (_optionalChain([Modules, 'access', _103 => _103.Content, 'access', _104 => _104.inclusions, 'optionalAccess', _105 => _105.lists, 'optionalAccess', _106 => _106.types])) endpoint.limitToType(Modules.Content.inclusions.lists.types);
2601
4040
  return this.callApi({
2602
4041
  type: Modules.Content,
2603
4042
  method: "GET" /* GET */,
@@ -2625,18 +4064,18 @@ var ContentModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factor
2625
4064
  }), "ContentModule");
2626
4065
 
2627
4066
  // src/features/feature/data/feature.ts
2628
- var Feature = (_class3 = class extends AbstractApiData {constructor(...args) { super(...args); _class3.prototype.__init.call(this); }
4067
+ var Feature = (_class8 = class extends AbstractApiData {constructor(...args6) { super(...args6); _class8.prototype.__init9.call(this); }
2629
4068
  static {
2630
4069
  _chunk7QVYU63Ejs.__name.call(void 0, this, "Feature");
2631
4070
  }
2632
4071
 
2633
4072
 
2634
- __init() {this._modules = []}
4073
+ __init9() {this._modules = []}
2635
4074
  get name() {
2636
4075
  return _nullishCoalesce(this._name, () => ( ""));
2637
4076
  }
2638
- get isProduction() {
2639
- return this._isProduction == true ? true : false;
4077
+ get isCore() {
4078
+ return this._isCore == true ? true : false;
2640
4079
  }
2641
4080
  get modules() {
2642
4081
  return this._modules;
@@ -2644,11 +4083,11 @@ var Feature = (_class3 = class extends AbstractApiData {constructor(...args) { s
2644
4083
  rehydrate(data) {
2645
4084
  super.rehydrate(data);
2646
4085
  this._name = data.jsonApi.attributes.name;
2647
- this._isProduction = _nullishCoalesce(data.jsonApi.attributes.isProduction, () => ( false));
4086
+ this._isCore = _nullishCoalesce(data.jsonApi.attributes.isCore, () => ( false));
2648
4087
  this._modules = this._readIncluded(data, `modules`, Modules.Module);
2649
4088
  return this;
2650
4089
  }
2651
- }, _class3);
4090
+ }, _class8);
2652
4091
 
2653
4092
  // src/features/feature/data/feature.service.ts
2654
4093
  var FeatureService = class extends AbstractService {
@@ -2683,14 +4122,10 @@ var Module = class extends AbstractApiData {
2683
4122
  }
2684
4123
 
2685
4124
 
2686
-
2687
4125
  get name() {
2688
4126
  if (!this._name) throw new Error("Name is not defined");
2689
4127
  return _nullishCoalesce(this._name, () => ( ""));
2690
4128
  }
2691
- get isCore() {
2692
- return _nullishCoalesce(this._isCore, () => ( false));
2693
- }
2694
4129
  get permissions() {
2695
4130
  if (!this._permissions) throw new Error("Permissions is not defined");
2696
4131
  return this._permissions;
@@ -2698,7 +4133,6 @@ var Module = class extends AbstractApiData {
2698
4133
  rehydrate(data) {
2699
4134
  super.rehydrate(data);
2700
4135
  this._name = data.jsonApi.attributes.name;
2701
- this._isCore = data.jsonApi.attributes.isCore;
2702
4136
  this._permissions = data.jsonApi.meta.permissions;
2703
4137
  return this;
2704
4138
  }
@@ -3104,7 +4538,7 @@ var S3Service = class extends AbstractService {
3104
4538
  };
3105
4539
 
3106
4540
  // src/features/user/data/user.ts
3107
- var User = (_class4 = class extends AbstractApiData {constructor(...args2) { super(...args2); _class4.prototype.__init2.call(this);_class4.prototype.__init3.call(this); }
4541
+ var User = (_class9 = class extends AbstractApiData {constructor(...args7) { super(...args7); _class9.prototype.__init10.call(this);_class9.prototype.__init11.call(this); }
3108
4542
  static {
3109
4543
  _chunk7QVYU63Ejs.__name.call(void 0, this, "User");
3110
4544
  }
@@ -3120,9 +4554,9 @@ var User = (_class4 = class extends AbstractApiData {constructor(...args2) { sup
3120
4554
 
3121
4555
 
3122
4556
 
3123
- __init2() {this._roles = []}
4557
+ __init10() {this._roles = []}
3124
4558
 
3125
- __init3() {this._modules = []}
4559
+ __init11() {this._modules = []}
3126
4560
  get searchResult() {
3127
4561
  return _nullishCoalesce(this._name, () => ( ""));
3128
4562
  }
@@ -3230,7 +4664,7 @@ var User = (_class4 = class extends AbstractApiData {constructor(...args2) { sup
3230
4664
  }
3231
4665
  return response;
3232
4666
  }
3233
- }, _class4);
4667
+ }, _class9);
3234
4668
 
3235
4669
  // src/features/user/data/user.fields.ts
3236
4670
  var UserFields = /* @__PURE__ */ ((UserFields2) => {
@@ -3299,8 +4733,8 @@ var UserService = class extends AbstractService {
3299
4733
  id: params.id,
3300
4734
  childEndpoint: "user-relevance"
3301
4735
  });
3302
- if (_optionalChain([Modules, 'access', _87 => _87.User, 'access', _88 => _88.inclusions, 'optionalAccess', _89 => _89.lists, 'optionalAccess', _90 => _90.fields])) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
3303
- if (_optionalChain([Modules, 'access', _91 => _91.User, 'access', _92 => _92.inclusions, 'optionalAccess', _93 => _93.lists, 'optionalAccess', _94 => _94.types])) endpoint.limitToType(Modules.User.inclusions.lists.types);
4736
+ if (_optionalChain([Modules, 'access', _107 => _107.User, 'access', _108 => _108.inclusions, 'optionalAccess', _109 => _109.lists, 'optionalAccess', _110 => _110.fields])) endpoint.limitToFields(Modules.User.inclusions.lists.fields);
4737
+ if (_optionalChain([Modules, 'access', _111 => _111.User, 'access', _112 => _112.inclusions, 'optionalAccess', _113 => _113.lists, 'optionalAccess', _114 => _114.types])) endpoint.limitToType(Modules.User.inclusions.lists.types);
3304
4738
  return this.callApi({
3305
4739
  type: Modules.User,
3306
4740
  method: "GET" /* GET */,
@@ -3422,6 +4856,14 @@ var UserService = class extends AbstractService {
3422
4856
  }
3423
4857
  };
3424
4858
 
4859
+ // src/features/user/author.module.ts
4860
+ var AuthorModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
4861
+ pageUrl: "/authors",
4862
+ name: "authors",
4863
+ model: User,
4864
+ moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277"
4865
+ }), "AuthorModule");
4866
+
3425
4867
  // src/features/user/user.module.ts
3426
4868
  var UserModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
3427
4869
  pageUrl: "/users",
@@ -3440,13 +4882,6 @@ var UserModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory)
3440
4882
  }
3441
4883
  }), "UserModule");
3442
4884
 
3443
- // src/features/user/author.module.ts
3444
- var AuthorModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
3445
- pageUrl: "/authors",
3446
- name: "authors",
3447
- model: User,
3448
- moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277"
3449
- }), "AuthorModule");
3450
4885
 
3451
4886
 
3452
4887
 
@@ -3536,5 +4971,29 @@ var AuthorModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory
3536
4971
 
3537
4972
 
3538
4973
 
3539
- exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.HttpMethod = HttpMethod; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.useIsMobile = useIsMobile; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.Auth = Auth; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.AuthService = AuthService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.UserModule = UserModule; exports.AuthorModule = AuthorModule;
3540
- //# sourceMappingURL=chunk-C6QXZGL7.js.map
4974
+
4975
+
4976
+
4977
+
4978
+
4979
+
4980
+
4981
+
4982
+
4983
+
4984
+
4985
+
4986
+
4987
+
4988
+
4989
+
4990
+
4991
+
4992
+
4993
+
4994
+
4995
+
4996
+
4997
+
4998
+ exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.HttpMethod = HttpMethod; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.useIsMobile = useIsMobile; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.Auth = Auth; exports.AuthService = AuthService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.BillingService = BillingService; exports.Billing = Billing; exports.BillingModule = BillingModule; exports.PaymentMethod = PaymentMethod; exports.StripeCustomer = StripeCustomer; exports.StripeCustomerService = StripeCustomerService; exports.StripeCustomerModule = StripeCustomerModule; exports.StripePaymentMethodModule = StripePaymentMethodModule; exports.StripeInvoice = StripeInvoice; exports.InvoiceStatus = InvoiceStatus; exports.StripeInvoiceService = StripeInvoiceService; exports.StripeInvoiceModule = StripeInvoiceModule; exports.StripePrice = StripePrice; exports.StripePriceService = StripePriceService; exports.StripePriceModule = StripePriceModule; exports.StripeProduct = StripeProduct; exports.StripeProductService = StripeProductService; exports.StripeProductModule = StripeProductModule; exports.StripeSubscription = StripeSubscription; exports.SubscriptionStatus = SubscriptionStatus; exports.StripeSubscriptionService = StripeSubscriptionService; exports.StripeSubscriptionModule = StripeSubscriptionModule; exports.StripeUsage = StripeUsage; exports.StripeUsageService = StripeUsageService; exports.StripeUsageModule = StripeUsageModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.AuthorModule = AuthorModule; exports.UserModule = UserModule;
4999
+ //# sourceMappingURL=chunk-2AZLCF6D.js.map