@antelopejs/dms-saas 0.0.1

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 (687) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +658 -0
  3. package/dist/auth/index.d.ts +3 -0
  4. package/dist/auth/index.js +20 -0
  5. package/dist/auth/index.js.map +1 -0
  6. package/dist/auth/oauth-entry.d.ts +5 -0
  7. package/dist/auth/oauth-entry.js +10 -0
  8. package/dist/auth/oauth-entry.js.map +1 -0
  9. package/dist/auth/plan-permissions-resolver.d.ts +1 -0
  10. package/dist/auth/plan-permissions-resolver.js +44 -0
  11. package/dist/auth/plan-permissions-resolver.js.map +1 -0
  12. package/dist/auth/subscription-access-gate.d.ts +8 -0
  13. package/dist/auth/subscription-access-gate.js +38 -0
  14. package/dist/auth/subscription-access-gate.js.map +1 -0
  15. package/dist/automation/index.d.ts +44 -0
  16. package/dist/automation/index.js +209 -0
  17. package/dist/automation/index.js.map +1 -0
  18. package/dist/billing-state/index.d.ts +5 -0
  19. package/dist/billing-state/index.js +58 -0
  20. package/dist/billing-state/index.js.map +1 -0
  21. package/dist/billing-state/recovery.d.ts +22 -0
  22. package/dist/billing-state/recovery.js +81 -0
  23. package/dist/billing-state/recovery.js.map +1 -0
  24. package/dist/config/dev-mode.d.ts +3 -0
  25. package/dist/config/dev-mode.js +27 -0
  26. package/dist/config/dev-mode.js.map +1 -0
  27. package/dist/config/index.d.ts +2 -0
  28. package/dist/config/index.js +19 -0
  29. package/dist/config/index.js.map +1 -0
  30. package/dist/config/runtime.d.ts +6 -0
  31. package/dist/config/runtime.js +54 -0
  32. package/dist/config/runtime.js.map +1 -0
  33. package/dist/crons/auto-suspend-past-due.d.ts +2 -0
  34. package/dist/crons/auto-suspend-past-due.js +43 -0
  35. package/dist/crons/auto-suspend-past-due.js.map +1 -0
  36. package/dist/crons/cleanup-stripe-webhook-events.d.ts +2 -0
  37. package/dist/crons/cleanup-stripe-webhook-events.js +27 -0
  38. package/dist/crons/cleanup-stripe-webhook-events.js.map +1 -0
  39. package/dist/crons/expire-free-workspaces.d.ts +2 -0
  40. package/dist/crons/expire-free-workspaces.js +36 -0
  41. package/dist/crons/expire-free-workspaces.js.map +1 -0
  42. package/dist/crons/hard-delete-cancelled.d.ts +2 -0
  43. package/dist/crons/hard-delete-cancelled.js +55 -0
  44. package/dist/crons/hard-delete-cancelled.js.map +1 -0
  45. package/dist/crons/index.d.ts +8 -0
  46. package/dist/crons/index.js +25 -0
  47. package/dist/crons/index.js.map +1 -0
  48. package/dist/crons/notify-free-workspaces-ending-soon.d.ts +2 -0
  49. package/dist/crons/notify-free-workspaces-ending-soon.js +69 -0
  50. package/dist/crons/notify-free-workspaces-ending-soon.js.map +1 -0
  51. package/dist/crons/recompute-billing-state.d.ts +2 -0
  52. package/dist/crons/recompute-billing-state.js +19 -0
  53. package/dist/crons/recompute-billing-state.js.map +1 -0
  54. package/dist/crons/recompute-segments.d.ts +2 -0
  55. package/dist/crons/recompute-segments.js +19 -0
  56. package/dist/crons/recompute-segments.js.map +1 -0
  57. package/dist/crons/reconcile-workspace-lifecycle.d.ts +2 -0
  58. package/dist/crons/reconcile-workspace-lifecycle.js +19 -0
  59. package/dist/crons/reconcile-workspace-lifecycle.js.map +1 -0
  60. package/dist/crons/register.d.ts +2 -0
  61. package/dist/crons/register.js +24 -0
  62. package/dist/crons/register.js.map +1 -0
  63. package/dist/crons/subscription-notifications.d.ts +2 -0
  64. package/dist/crons/subscription-notifications.js +55 -0
  65. package/dist/crons/subscription-notifications.js.map +1 -0
  66. package/dist/data-api/index.d.ts +2 -0
  67. package/dist/data-api/index.js +19 -0
  68. package/dist/data-api/index.js.map +1 -0
  69. package/dist/data-api/platformOwner/admin-user-invoices.d.ts +27 -0
  70. package/dist/data-api/platformOwner/admin-user-invoices.js +158 -0
  71. package/dist/data-api/platformOwner/admin-user-invoices.js.map +1 -0
  72. package/dist/data-api/platformOwner/admin-user-workspaces.d.ts +22 -0
  73. package/dist/data-api/platformOwner/admin-user-workspaces.js +97 -0
  74. package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -0
  75. package/dist/data-api/platformOwner/credit-notes.d.ts +24 -0
  76. package/dist/data-api/platformOwner/credit-notes.js +133 -0
  77. package/dist/data-api/platformOwner/credit-notes.js.map +1 -0
  78. package/dist/data-api/platformOwner/features.d.ts +30 -0
  79. package/dist/data-api/platformOwner/features.js +141 -0
  80. package/dist/data-api/platformOwner/features.js.map +1 -0
  81. package/dist/data-api/platformOwner/hidden-filter.d.ts +1 -0
  82. package/dist/data-api/platformOwner/hidden-filter.js +18 -0
  83. package/dist/data-api/platformOwner/hidden-filter.js.map +1 -0
  84. package/dist/data-api/platformOwner/index.d.ts +12 -0
  85. package/dist/data-api/platformOwner/index.js +29 -0
  86. package/dist/data-api/platformOwner/index.js.map +1 -0
  87. package/dist/data-api/platformOwner/invoice-options.d.ts +7 -0
  88. package/dist/data-api/platformOwner/invoice-options.js +14 -0
  89. package/dist/data-api/platformOwner/invoice-options.js.map +1 -0
  90. package/dist/data-api/platformOwner/invoices.d.ts +26 -0
  91. package/dist/data-api/platformOwner/invoices.js +147 -0
  92. package/dist/data-api/platformOwner/invoices.js.map +1 -0
  93. package/dist/data-api/platformOwner/members.d.ts +24 -0
  94. package/dist/data-api/platformOwner/members.js +125 -0
  95. package/dist/data-api/platformOwner/members.js.map +1 -0
  96. package/dist/data-api/platformOwner/plan-migrations.d.ts +24 -0
  97. package/dist/data-api/platformOwner/plan-migrations.js +138 -0
  98. package/dist/data-api/platformOwner/plan-migrations.js.map +1 -0
  99. package/dist/data-api/platformOwner/plans.d.ts +30 -0
  100. package/dist/data-api/platformOwner/plans.js +228 -0
  101. package/dist/data-api/platformOwner/plans.js.map +1 -0
  102. package/dist/data-api/platformOwner/segments.d.ts +29 -0
  103. package/dist/data-api/platformOwner/segments.js +223 -0
  104. package/dist/data-api/platformOwner/segments.js.map +1 -0
  105. package/dist/data-api/platformOwner/support.d.ts +58 -0
  106. package/dist/data-api/platformOwner/support.js +111 -0
  107. package/dist/data-api/platformOwner/support.js.map +1 -0
  108. package/dist/data-api/platformOwner/users.d.ts +22 -0
  109. package/dist/data-api/platformOwner/users.js +128 -0
  110. package/dist/data-api/platformOwner/users.js.map +1 -0
  111. package/dist/data-api/platformOwner/workspaces.d.ts +22 -0
  112. package/dist/data-api/platformOwner/workspaces.js +153 -0
  113. package/dist/data-api/platformOwner/workspaces.js.map +1 -0
  114. package/dist/data-api/support-fields.d.ts +49 -0
  115. package/dist/data-api/support-fields.js +166 -0
  116. package/dist/data-api/support-fields.js.map +1 -0
  117. package/dist/data-api/support-routes.d.ts +10 -0
  118. package/dist/data-api/support-routes.js +71 -0
  119. package/dist/data-api/support-routes.js.map +1 -0
  120. package/dist/data-api/tenant/index.d.ts +2 -0
  121. package/dist/data-api/tenant/index.js +19 -0
  122. package/dist/data-api/tenant/index.js.map +1 -0
  123. package/dist/data-api/tenant/support.d.ts +39 -0
  124. package/dist/data-api/tenant/support.js +53 -0
  125. package/dist/data-api/tenant/support.js.map +1 -0
  126. package/dist/data-api/tenant/tenant-invoices.d.ts +37 -0
  127. package/dist/data-api/tenant/tenant-invoices.js +242 -0
  128. package/dist/data-api/tenant/tenant-invoices.js.map +1 -0
  129. package/dist/db/index.d.ts +1 -0
  130. package/dist/db/index.js +18 -0
  131. package/dist/db/index.js.map +1 -0
  132. package/dist/hooks/index.d.ts +3 -0
  133. package/dist/hooks/index.js +20 -0
  134. package/dist/hooks/index.js.map +1 -0
  135. package/dist/hooks/register.d.ts +1 -0
  136. package/dist/hooks/register.js +57 -0
  137. package/dist/hooks/register.js.map +1 -0
  138. package/dist/hooks/tenant-export.d.ts +2 -0
  139. package/dist/hooks/tenant-export.js +64 -0
  140. package/dist/hooks/tenant-export.js.map +1 -0
  141. package/dist/hooks/tenant-provisioning.d.ts +3 -0
  142. package/dist/hooks/tenant-provisioning.js +12 -0
  143. package/dist/hooks/tenant-provisioning.js.map +1 -0
  144. package/dist/implementations/dms-saas/billing.d.ts +2 -0
  145. package/dist/implementations/dms-saas/billing.js +49 -0
  146. package/dist/implementations/dms-saas/billing.js.map +1 -0
  147. package/dist/implementations/dms-saas/invoice-line-items.d.ts +11 -0
  148. package/dist/implementations/dms-saas/invoice-line-items.js +24 -0
  149. package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -0
  150. package/dist/implementations/dms-saas/pages.d.ts +3 -0
  151. package/dist/implementations/dms-saas/pages.js +12 -0
  152. package/dist/implementations/dms-saas/pages.js.map +1 -0
  153. package/dist/implementations/dms-saas/workspace-lifecycle.d.ts +2 -0
  154. package/dist/implementations/dms-saas/workspace-lifecycle.js +23 -0
  155. package/dist/implementations/dms-saas/workspace-lifecycle.js.map +1 -0
  156. package/dist/index.d.ts +8 -0
  157. package/dist/index.js +107 -0
  158. package/dist/index.js.map +1 -0
  159. package/dist/invoice-line-items/billing-window.d.ts +3 -0
  160. package/dist/invoice-line-items/billing-window.js +19 -0
  161. package/dist/invoice-line-items/billing-window.js.map +1 -0
  162. package/dist/invoice-line-items/index.d.ts +1 -0
  163. package/dist/invoice-line-items/index.js +18 -0
  164. package/dist/invoice-line-items/index.js.map +1 -0
  165. package/dist/invoice-line-items/injection.d.ts +2 -0
  166. package/dist/invoice-line-items/injection.js +171 -0
  167. package/dist/invoice-line-items/injection.js.map +1 -0
  168. package/dist/notifications/index.d.ts +2 -0
  169. package/dist/notifications/index.js +19 -0
  170. package/dist/notifications/index.js.map +1 -0
  171. package/dist/notifications/recipients.d.ts +14 -0
  172. package/dist/notifications/recipients.js +87 -0
  173. package/dist/notifications/recipients.js.map +1 -0
  174. package/dist/notifications/subjects.d.ts +21 -0
  175. package/dist/notifications/subjects.js +121 -0
  176. package/dist/notifications/subjects.js.map +1 -0
  177. package/dist/operator-actions/commands.d.ts +41 -0
  178. package/dist/operator-actions/commands.js +233 -0
  179. package/dist/operator-actions/commands.js.map +1 -0
  180. package/dist/operator-actions/db/index.d.ts +4 -0
  181. package/dist/operator-actions/db/index.js +21 -0
  182. package/dist/operator-actions/db/index.js.map +1 -0
  183. package/dist/operator-actions/db/lifecycle-delivery.model.d.ts +29 -0
  184. package/dist/operator-actions/db/lifecycle-delivery.model.js +85 -0
  185. package/dist/operator-actions/db/lifecycle-delivery.model.js.map +1 -0
  186. package/dist/operator-actions/db/lifecycle-delivery.table.d.ts +26 -0
  187. package/dist/operator-actions/db/lifecycle-delivery.table.js +107 -0
  188. package/dist/operator-actions/db/lifecycle-delivery.table.js.map +1 -0
  189. package/dist/operator-actions/db/operator-action.model.d.ts +33 -0
  190. package/dist/operator-actions/db/operator-action.model.js +63 -0
  191. package/dist/operator-actions/db/operator-action.model.js.map +1 -0
  192. package/dist/operator-actions/db/operator-action.table.d.ts +21 -0
  193. package/dist/operator-actions/db/operator-action.table.js +95 -0
  194. package/dist/operator-actions/db/operator-action.table.js.map +1 -0
  195. package/dist/operator-actions/index.d.ts +3 -0
  196. package/dist/operator-actions/index.js +20 -0
  197. package/dist/operator-actions/index.js.map +1 -0
  198. package/dist/operator-actions/journal.d.ts +22 -0
  199. package/dist/operator-actions/journal.js +183 -0
  200. package/dist/operator-actions/journal.js.map +1 -0
  201. package/dist/operator-actions/lifecycle-consumers.d.ts +12 -0
  202. package/dist/operator-actions/lifecycle-consumers.js +28 -0
  203. package/dist/operator-actions/lifecycle-consumers.js.map +1 -0
  204. package/dist/operator-actions/lifecycle-outbox.d.ts +19 -0
  205. package/dist/operator-actions/lifecycle-outbox.js +229 -0
  206. package/dist/operator-actions/lifecycle-outbox.js.map +1 -0
  207. package/dist/operator-actions/types.d.ts +11 -0
  208. package/dist/operator-actions/types.js +3 -0
  209. package/dist/operator-actions/types.js.map +1 -0
  210. package/dist/pages/definitions.d.ts +1 -0
  211. package/dist/pages/definitions.js +18 -0
  212. package/dist/pages/definitions.js.map +1 -0
  213. package/dist/pages/index.d.ts +4 -0
  214. package/dist/pages/index.js +21 -0
  215. package/dist/pages/index.js.map +1 -0
  216. package/dist/pages/module.d.ts +5 -0
  217. package/dist/pages/module.js +15 -0
  218. package/dist/pages/module.js.map +1 -0
  219. package/dist/pages/platform/categories.d.ts +6 -0
  220. package/dist/pages/platform/categories.js +48 -0
  221. package/dist/pages/platform/categories.js.map +1 -0
  222. package/dist/pages/platform/credit-notes.d.ts +9 -0
  223. package/dist/pages/platform/credit-notes.js +40 -0
  224. package/dist/pages/platform/credit-notes.js.map +1 -0
  225. package/dist/pages/platform/dashboard.d.ts +10 -0
  226. package/dist/pages/platform/dashboard.js +95 -0
  227. package/dist/pages/platform/dashboard.js.map +1 -0
  228. package/dist/pages/platform/features.d.ts +9 -0
  229. package/dist/pages/platform/features.js +42 -0
  230. package/dist/pages/platform/features.js.map +1 -0
  231. package/dist/pages/platform/index.d.ts +15 -0
  232. package/dist/pages/platform/index.js +32 -0
  233. package/dist/pages/platform/index.js.map +1 -0
  234. package/dist/pages/platform/invoices.d.ts +9 -0
  235. package/dist/pages/platform/invoices.js +63 -0
  236. package/dist/pages/platform/invoices.js.map +1 -0
  237. package/dist/pages/platform/plans/edit.d.ts +17 -0
  238. package/dist/pages/platform/plans/edit.js +213 -0
  239. package/dist/pages/platform/plans/edit.js.map +1 -0
  240. package/dist/pages/platform/plans/index.d.ts +9 -0
  241. package/dist/pages/platform/plans/index.js +99 -0
  242. package/dist/pages/platform/plans/index.js.map +1 -0
  243. package/dist/pages/platform/plans/migrations.d.ts +9 -0
  244. package/dist/pages/platform/plans/migrations.js +38 -0
  245. package/dist/pages/platform/plans/migrations.js.map +1 -0
  246. package/dist/pages/platform/segments/index.d.ts +9 -0
  247. package/dist/pages/platform/segments/index.js +59 -0
  248. package/dist/pages/platform/segments/index.js.map +1 -0
  249. package/dist/pages/platform/settings.d.ts +9 -0
  250. package/dist/pages/platform/settings.js +147 -0
  251. package/dist/pages/platform/settings.js.map +1 -0
  252. package/dist/pages/platform/support.d.ts +9 -0
  253. package/dist/pages/platform/support.js +29 -0
  254. package/dist/pages/platform/support.js.map +1 -0
  255. package/dist/pages/platform/users/detail.d.ts +9 -0
  256. package/dist/pages/platform/users/detail.js +78 -0
  257. package/dist/pages/platform/users/detail.js.map +1 -0
  258. package/dist/pages/platform/users/index.d.ts +9 -0
  259. package/dist/pages/platform/users/index.js +77 -0
  260. package/dist/pages/platform/users/index.js.map +1 -0
  261. package/dist/pages/platform/workspaces/detail.d.ts +9 -0
  262. package/dist/pages/platform/workspaces/detail.js +120 -0
  263. package/dist/pages/platform/workspaces/detail.js.map +1 -0
  264. package/dist/pages/platform/workspaces/index.d.ts +35 -0
  265. package/dist/pages/platform/workspaces/index.js +300 -0
  266. package/dist/pages/platform/workspaces/index.js.map +1 -0
  267. package/dist/pages/public/auth/index.d.ts +1 -0
  268. package/dist/pages/public/auth/index.js +18 -0
  269. package/dist/pages/public/auth/index.js.map +1 -0
  270. package/dist/pages/public/auth/no-workspace.d.ts +9 -0
  271. package/dist/pages/public/auth/no-workspace.js +26 -0
  272. package/dist/pages/public/auth/no-workspace.js.map +1 -0
  273. package/dist/pages/public/index.d.ts +3 -0
  274. package/dist/pages/public/index.js +20 -0
  275. package/dist/pages/public/index.js.map +1 -0
  276. package/dist/pages/public/legal/index.d.ts +3 -0
  277. package/dist/pages/public/legal/index.js +20 -0
  278. package/dist/pages/public/legal/index.js.map +1 -0
  279. package/dist/pages/public/legal/privacy-policy.d.ts +9 -0
  280. package/dist/pages/public/legal/privacy-policy.js +29 -0
  281. package/dist/pages/public/legal/privacy-policy.js.map +1 -0
  282. package/dist/pages/public/legal/terms-and-conditions.d.ts +9 -0
  283. package/dist/pages/public/legal/terms-and-conditions.js +29 -0
  284. package/dist/pages/public/legal/terms-and-conditions.js.map +1 -0
  285. package/dist/pages/public/legal/terms-of-use.d.ts +9 -0
  286. package/dist/pages/public/legal/terms-of-use.js +29 -0
  287. package/dist/pages/public/legal/terms-of-use.js.map +1 -0
  288. package/dist/pages/public/register.d.ts +9 -0
  289. package/dist/pages/public/register.js +29 -0
  290. package/dist/pages/public/register.js.map +1 -0
  291. package/dist/pages/public/screens.d.ts +3 -0
  292. package/dist/pages/public/screens.js +50 -0
  293. package/dist/pages/public/screens.js.map +1 -0
  294. package/dist/pages/tenant/billing.d.ts +15 -0
  295. package/dist/pages/tenant/billing.js +87 -0
  296. package/dist/pages/tenant/billing.js.map +1 -0
  297. package/dist/pages/tenant/data-export.d.ts +10 -0
  298. package/dist/pages/tenant/data-export.js +32 -0
  299. package/dist/pages/tenant/data-export.js.map +1 -0
  300. package/dist/pages/tenant/general.d.ts +10 -0
  301. package/dist/pages/tenant/general.js +33 -0
  302. package/dist/pages/tenant/general.js.map +1 -0
  303. package/dist/pages/tenant/index.d.ts +6 -0
  304. package/dist/pages/tenant/index.js +23 -0
  305. package/dist/pages/tenant/index.js.map +1 -0
  306. package/dist/pages/tenant/members-seat-quota.d.ts +3 -0
  307. package/dist/pages/tenant/members-seat-quota.js +25 -0
  308. package/dist/pages/tenant/members-seat-quota.js.map +1 -0
  309. package/dist/pages/tenant/support.d.ts +9 -0
  310. package/dist/pages/tenant/support.js +27 -0
  311. package/dist/pages/tenant/support.js.map +1 -0
  312. package/dist/pages/tenant/workspace-suspended.d.ts +9 -0
  313. package/dist/pages/tenant/workspace-suspended.js +26 -0
  314. package/dist/pages/tenant/workspace-suspended.js.map +1 -0
  315. package/dist/plan-changes/deferred.d.ts +18 -0
  316. package/dist/plan-changes/deferred.js +225 -0
  317. package/dist/plan-changes/deferred.js.map +1 -0
  318. package/dist/plan-changes/index.d.ts +1 -0
  319. package/dist/plan-changes/index.js +18 -0
  320. package/dist/plan-changes/index.js.map +1 -0
  321. package/dist/plans/index.d.ts +4 -0
  322. package/dist/plans/index.js +21 -0
  323. package/dist/plans/index.js.map +1 -0
  324. package/dist/plans/seat-capacity.d.ts +9 -0
  325. package/dist/plans/seat-capacity.js +38 -0
  326. package/dist/plans/seat-capacity.js.map +1 -0
  327. package/dist/plans/seat-hooks.d.ts +1 -0
  328. package/dist/plans/seat-hooks.js +80 -0
  329. package/dist/plans/seat-hooks.js.map +1 -0
  330. package/dist/plans/seat-sync.d.ts +10 -0
  331. package/dist/plans/seat-sync.js +23 -0
  332. package/dist/plans/seat-sync.js.map +1 -0
  333. package/dist/routes/index.d.ts +3 -0
  334. package/dist/routes/index.js +20 -0
  335. package/dist/routes/index.js.map +1 -0
  336. package/dist/routes/platformOwner/billing-settings.d.ts +20 -0
  337. package/dist/routes/platformOwner/billing-settings.js +98 -0
  338. package/dist/routes/platformOwner/billing-settings.js.map +1 -0
  339. package/dist/routes/platformOwner/credit-notes-issue.d.ts +16 -0
  340. package/dist/routes/platformOwner/credit-notes-issue.js +56 -0
  341. package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -0
  342. package/dist/routes/platformOwner/dashboard.d.ts +62 -0
  343. package/dist/routes/platformOwner/dashboard.js +310 -0
  344. package/dist/routes/platformOwner/dashboard.js.map +1 -0
  345. package/dist/routes/platformOwner/index.d.ts +12 -0
  346. package/dist/routes/platformOwner/index.js +29 -0
  347. package/dist/routes/platformOwner/index.js.map +1 -0
  348. package/dist/routes/platformOwner/plan-deletion.d.ts +30 -0
  349. package/dist/routes/platformOwner/plan-deletion.js +156 -0
  350. package/dist/routes/platformOwner/plan-deletion.js.map +1 -0
  351. package/dist/routes/platformOwner/plans.d.ts +99 -0
  352. package/dist/routes/platformOwner/plans.js +376 -0
  353. package/dist/routes/platformOwner/plans.js.map +1 -0
  354. package/dist/routes/platformOwner/platform-notes.d.ts +36 -0
  355. package/dist/routes/platformOwner/platform-notes.js +149 -0
  356. package/dist/routes/platformOwner/platform-notes.js.map +1 -0
  357. package/dist/routes/platformOwner/platform-owners.d.ts +12 -0
  358. package/dist/routes/platformOwner/platform-owners.js +77 -0
  359. package/dist/routes/platformOwner/platform-owners.js.map +1 -0
  360. package/dist/routes/platformOwner/segments.d.ts +24 -0
  361. package/dist/routes/platformOwner/segments.js +174 -0
  362. package/dist/routes/platformOwner/segments.js.map +1 -0
  363. package/dist/routes/platformOwner/support.d.ts +21 -0
  364. package/dist/routes/platformOwner/support.js +180 -0
  365. package/dist/routes/platformOwner/support.js.map +1 -0
  366. package/dist/routes/platformOwner/users-detail.d.ts +26 -0
  367. package/dist/routes/platformOwner/users-detail.js +82 -0
  368. package/dist/routes/platformOwner/users-detail.js.map +1 -0
  369. package/dist/routes/platformOwner/workspace-operator-actions.d.ts +34 -0
  370. package/dist/routes/platformOwner/workspace-operator-actions.js +183 -0
  371. package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -0
  372. package/dist/routes/platformOwner/workspaces-admin.d.ts +27 -0
  373. package/dist/routes/platformOwner/workspaces-admin.js +140 -0
  374. package/dist/routes/platformOwner/workspaces-admin.js.map +1 -0
  375. package/dist/routes/public/index.d.ts +3 -0
  376. package/dist/routes/public/index.js +20 -0
  377. package/dist/routes/public/index.js.map +1 -0
  378. package/dist/routes/public/legal-documents.d.ts +15 -0
  379. package/dist/routes/public/legal-documents.js +72 -0
  380. package/dist/routes/public/legal-documents.js.map +1 -0
  381. package/dist/routes/public/register.d.ts +48 -0
  382. package/dist/routes/public/register.js +193 -0
  383. package/dist/routes/public/register.js.map +1 -0
  384. package/dist/routes/public/webhooks/index.d.ts +1 -0
  385. package/dist/routes/public/webhooks/index.js +18 -0
  386. package/dist/routes/public/webhooks/index.js.map +1 -0
  387. package/dist/routes/public/webhooks/stripe.d.ts +7 -0
  388. package/dist/routes/public/webhooks/stripe.js +41 -0
  389. package/dist/routes/public/webhooks/stripe.js.map +1 -0
  390. package/dist/routes/tenant/billing-portal.d.ts +31 -0
  391. package/dist/routes/tenant/billing-portal.js +117 -0
  392. package/dist/routes/tenant/billing-portal.js.map +1 -0
  393. package/dist/routes/tenant/billing-self-refund.d.ts +18 -0
  394. package/dist/routes/tenant/billing-self-refund.js +199 -0
  395. package/dist/routes/tenant/billing-self-refund.js.map +1 -0
  396. package/dist/routes/tenant/data-export.d.ts +16 -0
  397. package/dist/routes/tenant/data-export.js +102 -0
  398. package/dist/routes/tenant/data-export.js.map +1 -0
  399. package/dist/routes/tenant/index.d.ts +9 -0
  400. package/dist/routes/tenant/index.js +26 -0
  401. package/dist/routes/tenant/index.js.map +1 -0
  402. package/dist/routes/tenant/support.d.ts +27 -0
  403. package/dist/routes/tenant/support.js +185 -0
  404. package/dist/routes/tenant/support.js.map +1 -0
  405. package/dist/routes/tenant/tenant-billing.d.ts +26 -0
  406. package/dist/routes/tenant/tenant-billing.js +148 -0
  407. package/dist/routes/tenant/tenant-billing.js.map +1 -0
  408. package/dist/routes/tenant/tenant-plan-ops.d.ts +57 -0
  409. package/dist/routes/tenant/tenant-plan-ops.js +244 -0
  410. package/dist/routes/tenant/tenant-plan-ops.js.map +1 -0
  411. package/dist/routes/tenant/tenant-plan.d.ts +19 -0
  412. package/dist/routes/tenant/tenant-plan.js +172 -0
  413. package/dist/routes/tenant/tenant-plan.js.map +1 -0
  414. package/dist/routes/tenant/tenant-seats.d.ts +17 -0
  415. package/dist/routes/tenant/tenant-seats.js +58 -0
  416. package/dist/routes/tenant/tenant-seats.js.map +1 -0
  417. package/dist/routes/tenant/workspaces.d.ts +78 -0
  418. package/dist/routes/tenant/workspaces.js +301 -0
  419. package/dist/routes/tenant/workspaces.js.map +1 -0
  420. package/dist/stripe/client.d.ts +6 -0
  421. package/dist/stripe/client.js +44 -0
  422. package/dist/stripe/client.js.map +1 -0
  423. package/dist/stripe/customer-balance.d.ts +12 -0
  424. package/dist/stripe/customer-balance.js +16 -0
  425. package/dist/stripe/customer-balance.js.map +1 -0
  426. package/dist/stripe/customer-billing.d.ts +33 -0
  427. package/dist/stripe/customer-billing.js +140 -0
  428. package/dist/stripe/customer-billing.js.map +1 -0
  429. package/dist/stripe/index.d.ts +11 -0
  430. package/dist/stripe/index.js +28 -0
  431. package/dist/stripe/index.js.map +1 -0
  432. package/dist/stripe/plan-schedule.d.ts +9 -0
  433. package/dist/stripe/plan-schedule.js +83 -0
  434. package/dist/stripe/plan-schedule.js.map +1 -0
  435. package/dist/stripe/proration.d.ts +2 -0
  436. package/dist/stripe/proration.js +19 -0
  437. package/dist/stripe/proration.js.map +1 -0
  438. package/dist/stripe/sync-plan.d.ts +2 -0
  439. package/dist/stripe/sync-plan.js +66 -0
  440. package/dist/stripe/sync-plan.js.map +1 -0
  441. package/dist/stripe/webhook-checkout.d.ts +3 -0
  442. package/dist/stripe/webhook-checkout.js +157 -0
  443. package/dist/stripe/webhook-checkout.js.map +1 -0
  444. package/dist/stripe/webhook-credit-notes.d.ts +3 -0
  445. package/dist/stripe/webhook-credit-notes.js +192 -0
  446. package/dist/stripe/webhook-credit-notes.js.map +1 -0
  447. package/dist/stripe/webhook-dispatch.d.ts +2 -0
  448. package/dist/stripe/webhook-dispatch.js +45 -0
  449. package/dist/stripe/webhook-dispatch.js.map +1 -0
  450. package/dist/stripe/webhook-handlers.d.ts +11 -0
  451. package/dist/stripe/webhook-handlers.js +318 -0
  452. package/dist/stripe/webhook-handlers.js.map +1 -0
  453. package/dist/stripe/webhook-shared.d.ts +28 -0
  454. package/dist/stripe/webhook-shared.js +126 -0
  455. package/dist/stripe/webhook-shared.js.map +1 -0
  456. package/dist/stripe/workspace-checkout.d.ts +29 -0
  457. package/dist/stripe/workspace-checkout.js +106 -0
  458. package/dist/stripe/workspace-checkout.js.map +1 -0
  459. package/dist/support/admissions.d.ts +36 -0
  460. package/dist/support/admissions.js +136 -0
  461. package/dist/support/admissions.js.map +1 -0
  462. package/dist/support/attachments.d.ts +12 -0
  463. package/dist/support/attachments.js +56 -0
  464. package/dist/support/attachments.js.map +1 -0
  465. package/dist/support/config.d.ts +19 -0
  466. package/dist/support/config.js +75 -0
  467. package/dist/support/config.js.map +1 -0
  468. package/dist/support/index.d.ts +6 -0
  469. package/dist/support/index.js +23 -0
  470. package/dist/support/index.js.map +1 -0
  471. package/dist/support/operations.d.ts +51 -0
  472. package/dist/support/operations.js +109 -0
  473. package/dist/support/operations.js.map +1 -0
  474. package/dist/support/plans.d.ts +6 -0
  475. package/dist/support/plans.js +130 -0
  476. package/dist/support/plans.js.map +1 -0
  477. package/dist/support/publications.d.ts +8 -0
  478. package/dist/support/publications.js +106 -0
  479. package/dist/support/publications.js.map +1 -0
  480. package/dist/support/recovery.d.ts +7 -0
  481. package/dist/support/recovery.js +43 -0
  482. package/dist/support/recovery.js.map +1 -0
  483. package/dist/support/service.d.ts +51 -0
  484. package/dist/support/service.js +143 -0
  485. package/dist/support/service.js.map +1 -0
  486. package/dist/support/transitions.d.ts +4 -0
  487. package/dist/support/transitions.js +29 -0
  488. package/dist/support/transitions.js.map +1 -0
  489. package/dist/support/uploads.d.ts +39 -0
  490. package/dist/support/uploads.js +115 -0
  491. package/dist/support/uploads.js.map +1 -0
  492. package/dist/support/validation.d.ts +15 -0
  493. package/dist/support/validation.js +54 -0
  494. package/dist/support/validation.js.map +1 -0
  495. package/dist/types/config.d.ts +16 -0
  496. package/dist/types/config.js +3 -0
  497. package/dist/types/config.js.map +1 -0
  498. package/dist/types/index.d.ts +1 -0
  499. package/dist/types/index.js +18 -0
  500. package/dist/types/index.js.map +1 -0
  501. package/dist/utils/billing-document-type.d.ts +3 -0
  502. package/dist/utils/billing-document-type.js +18 -0
  503. package/dist/utils/billing-document-type.js.map +1 -0
  504. package/dist/utils/billing-period-type.d.ts +3 -0
  505. package/dist/utils/billing-period-type.js +18 -0
  506. package/dist/utils/billing-period-type.js.map +1 -0
  507. package/dist/utils/email-hash.d.ts +1 -0
  508. package/dist/utils/email-hash.js +8 -0
  509. package/dist/utils/email-hash.js.map +1 -0
  510. package/dist/utils/export-dataset-stream.d.ts +19 -0
  511. package/dist/utils/export-dataset-stream.js +40 -0
  512. package/dist/utils/export-dataset-stream.js.map +1 -0
  513. package/dist/utils/index.d.ts +15 -0
  514. package/dist/utils/index.js +32 -0
  515. package/dist/utils/index.js.map +1 -0
  516. package/dist/utils/invoice-lines-type.d.ts +27 -0
  517. package/dist/utils/invoice-lines-type.js +34 -0
  518. package/dist/utils/invoice-lines-type.js.map +1 -0
  519. package/dist/utils/money-cents-type.d.ts +3 -0
  520. package/dist/utils/money-cents-type.js +18 -0
  521. package/dist/utils/money-cents-type.js.map +1 -0
  522. package/dist/utils/pagination.d.ts +22 -0
  523. package/dist/utils/pagination.js +35 -0
  524. package/dist/utils/pagination.js.map +1 -0
  525. package/dist/utils/parse-future-date.d.ts +1 -0
  526. package/dist/utils/parse-future-date.js +15 -0
  527. package/dist/utils/parse-future-date.js.map +1 -0
  528. package/dist/utils/row-instance.d.ts +1 -0
  529. package/dist/utils/row-instance.js +8 -0
  530. package/dist/utils/row-instance.js.map +1 -0
  531. package/dist/utils/segment-conditions-type.d.ts +33 -0
  532. package/dist/utils/segment-conditions-type.js +86 -0
  533. package/dist/utils/segment-conditions-type.js.map +1 -0
  534. package/dist/utils/segment-evaluator.d.ts +3 -0
  535. package/dist/utils/segment-evaluator.js +117 -0
  536. package/dist/utils/segment-evaluator.js.map +1 -0
  537. package/dist/utils/segment-fields.d.ts +19 -0
  538. package/dist/utils/segment-fields.js +212 -0
  539. package/dist/utils/segment-fields.js.map +1 -0
  540. package/dist/utils/segment-matching.d.ts +56 -0
  541. package/dist/utils/segment-matching.js +200 -0
  542. package/dist/utils/segment-matching.js.map +1 -0
  543. package/dist/utils/segment-name-cache.d.ts +2 -0
  544. package/dist/utils/segment-name-cache.js +22 -0
  545. package/dist/utils/segment-name-cache.js.map +1 -0
  546. package/dist/utils/time.d.ts +3 -0
  547. package/dist/utils/time.js +10 -0
  548. package/dist/utils/time.js.map +1 -0
  549. package/dist/workers/index.d.ts +1 -0
  550. package/dist/workers/index.js +18 -0
  551. package/dist/workers/index.js.map +1 -0
  552. package/dist/workers/plan-migration.d.ts +4 -0
  553. package/dist/workers/plan-migration.js +206 -0
  554. package/dist/workers/plan-migration.js.map +1 -0
  555. package/dist/workspaces/billing-profile.d.ts +3 -0
  556. package/dist/workspaces/billing-profile.js +55 -0
  557. package/dist/workspaces/billing-profile.js.map +1 -0
  558. package/dist/workspaces/complimentary.d.ts +7 -0
  559. package/dist/workspaces/complimentary.js +47 -0
  560. package/dist/workspaces/complimentary.js.map +1 -0
  561. package/dist/workspaces/db/card-capacity.model.d.ts +30 -0
  562. package/dist/workspaces/db/card-capacity.model.js +98 -0
  563. package/dist/workspaces/db/card-capacity.model.js.map +1 -0
  564. package/dist/workspaces/db/card-capacity.table.d.ts +11 -0
  565. package/dist/workspaces/db/card-capacity.table.js +34 -0
  566. package/dist/workspaces/db/card-capacity.table.js.map +1 -0
  567. package/dist/workspaces/db/provisioning-attempt.model.d.ts +24 -0
  568. package/dist/workspaces/db/provisioning-attempt.model.js +33 -0
  569. package/dist/workspaces/db/provisioning-attempt.model.js.map +1 -0
  570. package/dist/workspaces/db/provisioning-attempt.table.d.ts +18 -0
  571. package/dist/workspaces/db/provisioning-attempt.table.js +77 -0
  572. package/dist/workspaces/db/provisioning-attempt.table.js.map +1 -0
  573. package/dist/workspaces/db/trial-identity.model.d.ts +25 -0
  574. package/dist/workspaces/db/trial-identity.model.js +62 -0
  575. package/dist/workspaces/db/trial-identity.model.js.map +1 -0
  576. package/dist/workspaces/db/trial-identity.table.d.ts +7 -0
  577. package/dist/workspaces/db/trial-identity.table.js +34 -0
  578. package/dist/workspaces/db/trial-identity.table.js.map +1 -0
  579. package/dist/workspaces/deletion.d.ts +8 -0
  580. package/dist/workspaces/deletion.js +75 -0
  581. package/dist/workspaces/deletion.js.map +1 -0
  582. package/dist/workspaces/free-workspace-guard.d.ts +11 -0
  583. package/dist/workspaces/free-workspace-guard.js +96 -0
  584. package/dist/workspaces/free-workspace-guard.js.map +1 -0
  585. package/dist/workspaces/index.d.ts +6 -0
  586. package/dist/workspaces/index.js +23 -0
  587. package/dist/workspaces/index.js.map +1 -0
  588. package/dist/workspaces/provisioning-rollback.d.ts +2 -0
  589. package/dist/workspaces/provisioning-rollback.js +78 -0
  590. package/dist/workspaces/provisioning-rollback.js.map +1 -0
  591. package/dist/workspaces/provisioning-state.d.ts +6 -0
  592. package/dist/workspaces/provisioning-state.js +91 -0
  593. package/dist/workspaces/provisioning-state.js.map +1 -0
  594. package/dist/workspaces/provisioning.d.ts +49 -0
  595. package/dist/workspaces/provisioning.js +263 -0
  596. package/dist/workspaces/provisioning.js.map +1 -0
  597. package/dist/workspaces/registration-extras.d.ts +1 -0
  598. package/dist/workspaces/registration-extras.js +50 -0
  599. package/dist/workspaces/registration-extras.js.map +1 -0
  600. package/dist/workspaces/suspension.d.ts +13 -0
  601. package/dist/workspaces/suspension.js +124 -0
  602. package/dist/workspaces/suspension.js.map +1 -0
  603. package/frontend-vue/.editorconfig +12 -0
  604. package/frontend-vue/.prettierrc +11 -0
  605. package/frontend-vue/app/build/.gitkeep +0 -0
  606. package/frontend-vue/app/components/CardGrid.vue +77 -0
  607. package/frontend-vue/app/components/CustomerPortalButton.vue +45 -0
  608. package/frontend-vue/app/components/DataExport.vue +300 -0
  609. package/frontend-vue/app/components/DeletePlanModal.vue +223 -0
  610. package/frontend-vue/app/components/FreeAccessBanner.vue +70 -0
  611. package/frontend-vue/app/components/InvoiceLines.vue +57 -0
  612. package/frontend-vue/app/components/IssueCreditNoteModal.vue +128 -0
  613. package/frontend-vue/app/components/LegalLayout.vue +63 -0
  614. package/frontend-vue/app/components/LoadFailure.vue +25 -0
  615. package/frontend-vue/app/components/PastDueAlert.vue +96 -0
  616. package/frontend-vue/app/components/PaymentMethodCard.vue +86 -0
  617. package/frontend-vue/app/components/PlanCard.vue +294 -0
  618. package/frontend-vue/app/components/PlanCardPublic.vue +59 -0
  619. package/frontend-vue/app/components/PlanCardsDisplay.vue +127 -0
  620. package/frontend-vue/app/components/PlanComparisonModal.vue +213 -0
  621. package/frontend-vue/app/components/PlanInheritancePicker.vue +329 -0
  622. package/frontend-vue/app/components/PlatformNotes.vue +281 -0
  623. package/frontend-vue/app/components/PlatformSupport.vue +461 -0
  624. package/frontend-vue/app/components/RecentActivity.vue +72 -0
  625. package/frontend-vue/app/components/RefundButton.vue +126 -0
  626. package/frontend-vue/app/components/Register.vue +174 -0
  627. package/frontend-vue/app/components/RegistrationClosed.vue +15 -0
  628. package/frontend-vue/app/components/SeatQuotaBanner.vue +78 -0
  629. package/frontend-vue/app/components/SegmentConditionsBuilder.vue +176 -0
  630. package/frontend-vue/app/components/SegmentConditionsGroup.vue +494 -0
  631. package/frontend-vue/app/components/SupportAttachmentUpload.vue +140 -0
  632. package/frontend-vue/app/components/SupportThreadHistory.vue +139 -0
  633. package/frontend-vue/app/components/TenantBillingForm.vue +208 -0
  634. package/frontend-vue/app/components/TenantPlanCard.vue +223 -0
  635. package/frontend-vue/app/components/TenantSupport.vue +415 -0
  636. package/frontend-vue/app/components/UserSummaryCard.vue +166 -0
  637. package/frontend-vue/app/components/WorkspaceBillingInfo.vue +68 -0
  638. package/frontend-vue/app/components/WorkspaceCompAccessButton.vue +198 -0
  639. package/frontend-vue/app/components/WorkspaceCreateModal.vue +256 -0
  640. package/frontend-vue/app/components/WorkspaceDangerZone.vue +146 -0
  641. package/frontend-vue/app/components/WorkspaceDetailHeader.vue +24 -0
  642. package/frontend-vue/app/components/WorkspaceIdentity.vue +99 -0
  643. package/frontend-vue/app/components/WorkspaceJoinButton.vue +50 -0
  644. package/frontend-vue/app/components/WorkspaceOperatorActions.vue +340 -0
  645. package/frontend-vue/app/components/WorkspaceSummaryCard.vue +161 -0
  646. package/frontend-vue/app/components/WorkspaceSuspendButton.vue +167 -0
  647. package/frontend-vue/app/components/WorkspaceSuspended.vue +164 -0
  648. package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +247 -0
  649. package/frontend-vue/app/composables/useApiErrorMessage.ts +35 -0
  650. package/frontend-vue/app/composables/useBillingCountries.ts +54 -0
  651. package/frontend-vue/app/composables/useBillingDocumentType.ts +7 -0
  652. package/frontend-vue/app/composables/useBillingStatus.ts +39 -0
  653. package/frontend-vue/app/composables/useCurrentWorkspace.ts +43 -0
  654. package/frontend-vue/app/composables/useDetailRefresh.ts +17 -0
  655. package/frontend-vue/app/composables/useExportHistory.ts +143 -0
  656. package/frontend-vue/app/composables/useInvoiceLines.ts +22 -0
  657. package/frontend-vue/app/composables/useMoneyFormat.ts +49 -0
  658. package/frontend-vue/app/composables/useMyWorkspaces.ts +47 -0
  659. package/frontend-vue/app/composables/usePlanFeatureFormat.ts +60 -0
  660. package/frontend-vue/app/composables/usePlanIntervalLabel.ts +30 -0
  661. package/frontend-vue/app/composables/useSaasRegistration.ts +522 -0
  662. package/frontend-vue/app/composables/useSeatQuota.ts +18 -0
  663. package/frontend-vue/app/composables/useSharedRequest.ts +54 -0
  664. package/frontend-vue/app/composables/useStripePaymentElement.ts +74 -0
  665. package/frontend-vue/app/composables/useSubscriptionAccess.ts +12 -0
  666. package/frontend-vue/app/composables/useSupportRequest.ts +74 -0
  667. package/frontend-vue/app/composables/useTenantPlan.ts +95 -0
  668. package/frontend-vue/app/composables/useTenantSwitch.ts +22 -0
  669. package/frontend-vue/app/composables/useWorkspaceAccessCache.ts +25 -0
  670. package/frontend-vue/app/custom-pages/auth/no-workspace.vue +495 -0
  671. package/frontend-vue/app/middleware/workspace-suspended.global.ts +56 -0
  672. package/frontend-vue/app/plugins/auth-links.ts +24 -0
  673. package/frontend-vue/app/plugins/billing-data-types.ts +62 -0
  674. package/frontend-vue/app/plugins/footer-links.ts +36 -0
  675. package/frontend-vue/app/plugins/plan-cards-display.client.ts +16 -0
  676. package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +122 -0
  677. package/frontend-vue/app/plugins/sidebar-widgets.ts +13 -0
  678. package/frontend-vue/app/types/support.ts +123 -0
  679. package/frontend-vue/dms.frontend.ts +68 -0
  680. package/frontend-vue/eslint.config.mjs +13 -0
  681. package/frontend-vue/i18n/locales/saas-en-GB.json +1285 -0
  682. package/frontend-vue/i18n/locales/saas-fr-FR.json +1285 -0
  683. package/frontend-vue/package.json +27 -0
  684. package/frontend-vue/pnpm-lock.yaml +4948 -0
  685. package/frontend-vue/pnpm-workspace.yaml +2 -0
  686. package/frontend-vue/server/routes/auth/finalize-workspace.post.ts +61 -0
  687. package/package.json +91 -0
package/dist/index.js ADDED
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.construct = construct;
40
+ exports.start = start;
41
+ exports.stop = stop;
42
+ const node_path_1 = __importDefault(require("node:path"));
43
+ const interface_core_1 = require("@antelopejs/interface-core");
44
+ const logging_1 = require("@antelopejs/interface-core/logging");
45
+ const page_1 = require("@antelopejs/interface-dms/page");
46
+ const billingInterface = __importStar(require("@antelopejs/interface-dms-saas/billing"));
47
+ const invoiceLineItemsInterface = __importStar(require("@antelopejs/interface-dms-saas/invoice-line-items"));
48
+ const pagesInterface = __importStar(require("@antelopejs/interface-dms-saas/pages"));
49
+ const workspaceLifecycleInterface = __importStar(require("@antelopejs/interface-dms-saas/workspace-lifecycle"));
50
+ const auth_1 = require("./auth");
51
+ const automation_1 = require("./automation");
52
+ const config_1 = require("./config");
53
+ const crons_1 = require("./crons");
54
+ const hooks_1 = require("./hooks");
55
+ const billingImplementation = __importStar(require("./implementations/dms-saas/billing"));
56
+ const invoiceLineItemsImplementation = __importStar(require("./implementations/dms-saas/invoice-line-items"));
57
+ const pagesImplementation = __importStar(require("./implementations/dms-saas/pages"));
58
+ const workspaceLifecycleImplementation = __importStar(require("./implementations/dms-saas/workspace-lifecycle"));
59
+ const pages_1 = require("./pages");
60
+ const plans_1 = require("./plans");
61
+ const stripe_1 = require("./stripe");
62
+ require("./data-api");
63
+ require("./db");
64
+ require("./notifications");
65
+ require("./routes");
66
+ let registeredCronTasks = [];
67
+ async function construct(config) {
68
+ (0, config_1.setRuntimeConfig)(config);
69
+ await (0, config_1.resolveDevMode)();
70
+ (0, stripe_1.initStripeClient)(config.stripe);
71
+ (0, hooks_1.registerSaasHookListeners)();
72
+ (0, auth_1.registerPlanPermissionsResolver)();
73
+ (0, auth_1.registerSubscriptionAccessGate)();
74
+ (0, plans_1.registerSeatHooks)();
75
+ (0, interface_core_1.ImplementInterface)(billingInterface, billingImplementation);
76
+ (0, interface_core_1.ImplementInterface)(invoiceLineItemsInterface, invoiceLineItemsImplementation);
77
+ (0, interface_core_1.ImplementInterface)(pagesInterface, pagesImplementation);
78
+ (0, interface_core_1.ImplementInterface)(workspaceLifecycleInterface, workspaceLifecycleImplementation);
79
+ await (0, pages_1.registerPublicScreens)(config);
80
+ await (0, page_1.AddFrontendModule)({
81
+ name: "@antelopejs/dms-saas-frontend-vue",
82
+ sourcePath: node_path_1.default.join(__dirname, "../frontend-vue"),
83
+ renderer: { name: "vue", version: "3" },
84
+ priority: 0,
85
+ options: {
86
+ dmsSaas: {
87
+ stripePublishableKey: config.stripe.publishableKey,
88
+ admissionMode: config.admissionMode ?? "open",
89
+ },
90
+ },
91
+ });
92
+ }
93
+ async function start() {
94
+ registeredCronTasks = (0, crons_1.registerSaasCrons)();
95
+ (0, automation_1.registerAutomationNodes)();
96
+ }
97
+ async function stop() {
98
+ const teardowns = await Promise.allSettled(registeredCronTasks.map(async (task) => task.destroy()));
99
+ for (const teardown of teardowns) {
100
+ if (teardown.status === "rejected") {
101
+ logging_1.Logging.Error("A cron task failed to stop", teardown.reason);
102
+ }
103
+ }
104
+ registeredCronTasks = [];
105
+ (0, automation_1.unregisterAutomationNodes)();
106
+ }
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,8BA6BC;AAED,sBAGC;AAED,oBAWC;AAnFD,0DAA6B;AAC7B,+DAAgE;AAChE,gEAA6D;AAC7D,yDAAmE;AACnE,yFAA2E;AAC3E,6GAA+F;AAC/F,qFAAuE;AACvE,gHAAkG;AAElG,iCAGgB;AAChB,6CAGsB;AACtB,qCAA4D;AAC5D,mCAA4C;AAC5C,mCAAoD;AACpD,0FAA4E;AAC5E,8GAAgG;AAChG,sFAAwE;AACxE,iHAAmG;AACnG,mCAAgD;AAChD,mCAA4C;AAC5C,qCAA4C;AAG5C,sBAAoB;AACpB,gBAAc;AACd,2BAAyB;AACzB,oBAAkB;AAElB,IAAI,mBAAmB,GAAoB,EAAE,CAAC;AAEvC,KAAK,UAAU,SAAS,CAAC,MAAqB;IACnD,IAAA,yBAAgB,EAAC,MAAM,CAAC,CAAC;IACzB,MAAM,IAAA,uBAAc,GAAE,CAAC;IACvB,IAAA,yBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChC,IAAA,iCAAyB,GAAE,CAAC;IAC5B,IAAA,sCAA+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,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,mBAAmB,GAAG,EAAE,CAAC;IACzB,IAAA,sCAAyB,GAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { InvoiceLineItemsContext } from "@antelopejs/interface-dms-saas/invoice-line-items";
2
+ import type { TenantSubscription } from "../db";
3
+ export declare function clipInvoiceUsageWindow(context: InvoiceLineItemsContext, subscription: TenantSubscription | undefined, stripeSubscriptionId: string | null): InvoiceLineItemsContext | null;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clipInvoiceUsageWindow = clipInvoiceUsageWindow;
4
+ const complimentary_1 = require("../workspaces/complimentary");
5
+ function clipInvoiceUsageWindow(context, subscription, stripeSubscriptionId) {
6
+ if ((0, complimentary_1.isComplimentarySubscription)(subscription))
7
+ return null;
8
+ if (!subscription?.paidUsagePeriods)
9
+ return context;
10
+ const period = subscription.paidUsagePeriods.find((candidate) => candidate.stripeSubscriptionId === stripeSubscriptionId);
11
+ if (!period)
12
+ return null;
13
+ const periodStart = new Date(Math.max(context.periodStart.getTime(), new Date(period.start).getTime()));
14
+ const periodEnd = new Date(Math.min(context.periodEnd.getTime(), period.end ? new Date(period.end).getTime() : context.periodEnd.getTime()));
15
+ if (periodStart >= periodEnd)
16
+ return null;
17
+ return { ...context, periodStart, periodEnd };
18
+ }
19
+ //# sourceMappingURL=billing-window.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-window.js","sourceRoot":"","sources":["../../src/invoice-line-items/billing-window.ts"],"names":[],"mappings":";;AAKA,wDAsBC;AAzBD,+DAA0E;AAG1E,SAAgB,sBAAsB,CACpC,OAAgC,EAChC,YAA4C,EAC5C,oBAAmC;IAEnC,IAAI,IAAA,2CAA2B,EAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,IAAI,CAAC,YAAY,EAAE,gBAAgB;QAAE,OAAO,OAAO,CAAC;IACpD,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAC/C,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,oBAAoB,KAAK,oBAAoB,CACvE,CAAC;IACF,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,WAAW,GAAG,IAAI,IAAI,CAC1B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAC1E,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,IAAI,CACxB,IAAI,CAAC,GAAG,CACN,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,EAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAC1E,CACF,CAAC;IACF,IAAI,WAAW,IAAI,SAAS;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./injection";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./injection"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/invoice-line-items/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
@@ -0,0 +1,2 @@
1
+ import type Stripe from "stripe";
2
+ export declare function injectProvidedInvoiceLineItems(invoice: Stripe.Invoice, tenantId: string, customerId: string): Promise<void>;
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.injectProvidedInvoiceLineItems = injectProvidedInvoiceLineItems;
4
+ const logging_1 = require("@antelopejs/interface-core/logging");
5
+ const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
6
+ const invoice_line_items_1 = require("@antelopejs/interface-dms-saas/invoice-line-items");
7
+ const invoice_line_items_2 = require("../implementations/dms-saas/invoice-line-items");
8
+ const client_1 = require("../stripe/client");
9
+ const db_1 = require("../db");
10
+ const billing_window_1 = require("./billing-window");
11
+ const LINE_KEY_METADATA = "saasLineKey";
12
+ const LINE_PROVIDER_METADATA = "saasLineProvider";
13
+ const LINE_QUANTITY_METADATA = "saasLineQuantity";
14
+ const LINE_UNIT_METADATA = "saasLineUnit";
15
+ const IDEMPOTENCY_KEY_PREFIX = "saas-invoice-line";
16
+ const CYCLE_RENEWAL_BILLING_REASON = "subscription_cycle";
17
+ const DRAFT_INVOICE_STATUS = "draft";
18
+ const INVOICE_ITEMS_PAGE_SIZE = 100;
19
+ const INVOICE_ITEMS_HARD_CAP = 250;
20
+ const CREATE_ATTEMPTS = 3;
21
+ const RETRY_DELAY_MS = 250;
22
+ const MS_PER_SECOND = 1000;
23
+ const LOG_PREFIX = "[dms-saas:invoice-line-items]";
24
+ const REPORTED_SKIP_REASONS = new Set([
25
+ "invalid",
26
+ "duplicate_key",
27
+ ]);
28
+ function canInjectIntoInvoice(invoice) {
29
+ if (invoice.billing_reason !== CYCLE_RENEWAL_BILLING_REASON)
30
+ return false;
31
+ if (invoice.status === DRAFT_INVOICE_STATUS)
32
+ return true;
33
+ logging_1.Logging.Warn(`${LOG_PREFIX} invoice ${invoice.id} was already '${invoice.status}' when the event was handled: this cycle's usage lines can no longer be added and will not be billed`);
34
+ return false;
35
+ }
36
+ function stripeSecondsToDate(seconds) {
37
+ return new Date(seconds * MS_PER_SECOND);
38
+ }
39
+ function toStripeSeconds(date) {
40
+ return Math.floor(date.getTime() / MS_PER_SECOND);
41
+ }
42
+ async function buildInjectionTarget(invoice, tenantId, customerId) {
43
+ const subscription = await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, tenantId).findOne();
44
+ const context = (0, billing_window_1.clipInvoiceUsageWindow)({
45
+ tenantId,
46
+ invoiceId: invoice.id,
47
+ currency: invoice.currency,
48
+ periodStart: stripeSecondsToDate(invoice.period_start),
49
+ periodEnd: stripeSecondsToDate(invoice.period_end),
50
+ }, subscription, typeof invoice.subscription === "string"
51
+ ? invoice.subscription
52
+ : (invoice.subscription?.id ?? null));
53
+ return context ? { customerId, context } : null;
54
+ }
55
+ async function fetchInjectedLineKeys(invoiceId) {
56
+ const stripe = (0, client_1.getStripeClient)();
57
+ const items = await stripe.invoiceItems
58
+ .list({ invoice: invoiceId, limit: INVOICE_ITEMS_PAGE_SIZE })
59
+ .autoPagingToArray({ limit: INVOICE_ITEMS_HARD_CAP });
60
+ const keys = items
61
+ .map((item) => item.metadata?.[LINE_KEY_METADATA])
62
+ .filter((key) => typeof key === "string");
63
+ return new Set(keys);
64
+ }
65
+ async function resolveProviderLineItems(provider, context) {
66
+ try {
67
+ const lineItems = await provider.resolve(context);
68
+ return {
69
+ lineItems: Array.isArray(lineItems) ? lineItems : [],
70
+ failures: 0,
71
+ };
72
+ }
73
+ catch (error) {
74
+ logging_1.Logging.Error(`${LOG_PREFIX} provider '${provider.id}' failed on invoice ${context.invoiceId}`, error);
75
+ return { lineItems: [], failures: 1 };
76
+ }
77
+ }
78
+ function reportSkippedLineItems(providerId, invoiceId, skipped) {
79
+ for (const line of skipped) {
80
+ if (!REPORTED_SKIP_REASONS.has(line.reason))
81
+ continue;
82
+ logging_1.Logging.Warn(`${LOG_PREFIX} provider '${providerId}' returned an unusable line '${line.lineKey}' on invoice ${invoiceId} (${line.reason})`);
83
+ }
84
+ }
85
+ function buildLineItemMetadata(providerId, prepared) {
86
+ const metadata = {
87
+ ...prepared.item.metadata,
88
+ };
89
+ if (prepared.item.quantity !== undefined) {
90
+ metadata[LINE_QUANTITY_METADATA] = String(prepared.item.quantity);
91
+ }
92
+ if (prepared.item.unit !== undefined) {
93
+ metadata[LINE_UNIT_METADATA] = prepared.item.unit;
94
+ }
95
+ metadata[LINE_PROVIDER_METADATA] = providerId;
96
+ metadata[LINE_KEY_METADATA] = prepared.lineKey;
97
+ return metadata;
98
+ }
99
+ async function createInvoiceLineItem(providerId, target, prepared) {
100
+ const { context } = target;
101
+ const stripe = (0, client_1.getStripeClient)();
102
+ await stripe.invoiceItems.create({
103
+ customer: target.customerId,
104
+ invoice: context.invoiceId,
105
+ currency: context.currency,
106
+ amount: prepared.item.amountCents,
107
+ description: prepared.item.description,
108
+ period: {
109
+ start: toStripeSeconds(context.periodStart),
110
+ end: toStripeSeconds(context.periodEnd),
111
+ },
112
+ metadata: buildLineItemMetadata(providerId, prepared),
113
+ }, {
114
+ idempotencyKey: `${IDEMPOTENCY_KEY_PREFIX}:${context.invoiceId}:${prepared.lineKey}`,
115
+ });
116
+ }
117
+ function delay(milliseconds) {
118
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
119
+ }
120
+ async function createInvoiceLineItemWithRetries(providerId, target, prepared) {
121
+ for (let attempt = 1; attempt <= CREATE_ATTEMPTS; attempt += 1) {
122
+ try {
123
+ await createInvoiceLineItem(providerId, target, prepared);
124
+ return;
125
+ }
126
+ catch (error) {
127
+ if (attempt === CREATE_ATTEMPTS)
128
+ throw error;
129
+ logging_1.Logging.Warn(`${LOG_PREFIX} retrying line '${prepared.lineKey}' on invoice ${target.context.invoiceId}`, error);
130
+ await delay(RETRY_DELAY_MS);
131
+ }
132
+ }
133
+ }
134
+ async function injectProviderLineItems(provider, target, injectedKeys) {
135
+ const { context } = target;
136
+ const resolution = await resolveProviderLineItems(provider, context);
137
+ const selection = (0, invoice_line_items_1.selectInvoiceLineItemsToCreate)(provider.id, resolution.lineItems, injectedKeys);
138
+ reportSkippedLineItems(provider.id, context.invoiceId, selection.skipped);
139
+ const invalidLines = selection.skipped.filter((line) => line.reason === "invalid").length;
140
+ let failures = resolution.failures + invalidLines;
141
+ for (const prepared of selection.accepted) {
142
+ try {
143
+ await createInvoiceLineItemWithRetries(provider.id, target, prepared);
144
+ injectedKeys.add(prepared.lineKey);
145
+ }
146
+ catch (error) {
147
+ failures += 1;
148
+ logging_1.Logging.Error(`${LOG_PREFIX} could not invoice line '${prepared.lineKey}' on invoice ${context.invoiceId}`, error);
149
+ }
150
+ }
151
+ return failures;
152
+ }
153
+ async function injectProvidedInvoiceLineItems(invoice, tenantId, customerId) {
154
+ const providers = (0, invoice_line_items_2.getInvoiceLineItemsProviders)();
155
+ if (providers.length === 0)
156
+ return;
157
+ if (!canInjectIntoInvoice(invoice))
158
+ return;
159
+ const target = await buildInjectionTarget(invoice, tenantId, customerId);
160
+ if (!target)
161
+ return;
162
+ const injectedKeys = await fetchInjectedLineKeys(target.context.invoiceId);
163
+ let failures = 0;
164
+ for (const provider of providers) {
165
+ failures += await injectProviderLineItems(provider, target, injectedKeys);
166
+ }
167
+ if (failures > 0) {
168
+ throw new Error(`${failures} usage line(s) could not be invoiced on ${target.context.invoiceId}`);
169
+ }
170
+ }
171
+ //# sourceMappingURL=injection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injection.js","sourceRoot":"","sources":["../../src/invoice-line-items/injection.ts"],"names":[],"mappings":";;A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,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./recipients";
2
+ export * from "./subjects";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./recipients"), exports);
18
+ __exportStar(require("./subjects"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B"}
@@ -0,0 +1,14 @@
1
+ import type { NotificationSubjectInfo } from "./subjects";
2
+ export interface SaasNotificationPayload {
3
+ icon: string;
4
+ title: string;
5
+ description: string;
6
+ linkTo?: string;
7
+ eventId?: string;
8
+ }
9
+ export declare function resolveTenantMemberRecipients(tenantId: string): Promise<string[]>;
10
+ export declare function resolveTenantOwners(tenantId: string): Promise<string[]>;
11
+ export declare function notifyTenantMembers(tenantId: string, subject: NotificationSubjectInfo, payload: SaasNotificationPayload): Promise<void>;
12
+ export declare function notifyTenantOwners(tenantId: string, subject: NotificationSubjectInfo, payload: SaasNotificationPayload): Promise<void>;
13
+ export declare function resolvePlatformOwners(excludeUserId?: string): Promise<string[]>;
14
+ export declare function notifyAllPlatformOwners(subject: NotificationSubjectInfo, payload: SaasNotificationPayload, excludeUserId?: string): Promise<void>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveTenantMemberRecipients = resolveTenantMemberRecipients;
4
+ exports.resolveTenantOwners = resolveTenantOwners;
5
+ exports.notifyTenantMembers = notifyTenantMembers;
6
+ exports.notifyTenantOwners = notifyTenantOwners;
7
+ exports.resolvePlatformOwners = resolvePlatformOwners;
8
+ exports.notifyAllPlatformOwners = notifyAllPlatformOwners;
9
+ const logging_1 = require("@antelopejs/interface-core/logging");
10
+ const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
11
+ const db_1 = require("@antelopejs/interface-dms/db");
12
+ const db_2 = require("@antelopejs/interface-dms/auth/db");
13
+ const notifications_1 = require("@antelopejs/interface-dms/notifications");
14
+ async function sendIdempotently(recipients, subject, payload, eventId) {
15
+ const builder = (0, notifications_1.Notification)()
16
+ .icon(payload.icon)
17
+ .title(payload.title)
18
+ .description(payload.description)
19
+ .subject(subject);
20
+ if (payload.linkTo)
21
+ builder.linkTo(payload.linkTo);
22
+ await builder.build().toUsersIdempotently(recipients, eventId);
23
+ }
24
+ async function sendOne(userId, subject, payload) {
25
+ const base = (0, notifications_1.Notification)()
26
+ .icon(payload.icon)
27
+ .title(payload.title)
28
+ .description(payload.description)
29
+ .subject(subject);
30
+ if (payload.linkTo) {
31
+ await base.linkTo(payload.linkTo).build().toUser(userId);
32
+ return;
33
+ }
34
+ await base.build().toUser(userId);
35
+ }
36
+ async function sendAll(recipients, subject, payload) {
37
+ const results = await Promise.allSettled(recipients.map((userId) => sendOne(userId, subject, payload)));
38
+ const failures = results.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
39
+ if (failures.length > 0) {
40
+ logging_1.Logging.Error(`[dms-saas:notifications] ${failures.length} delivery attempt(s) failed`, new AggregateError(failures));
41
+ }
42
+ }
43
+ async function deliverNotification(resolveRecipients, subject, payload) {
44
+ if (payload.eventId !== undefined) {
45
+ await sendIdempotently(await resolveRecipients(), subject, payload, payload.eventId);
46
+ return;
47
+ }
48
+ try {
49
+ await sendAll(await resolveRecipients(), subject, payload);
50
+ }
51
+ catch (error) {
52
+ logging_1.Logging.Error("[dms-saas:notifications] recipient resolution failed", error);
53
+ }
54
+ }
55
+ async function resolveTenantMemberRecipients(tenantId) {
56
+ const memberModel = (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId);
57
+ const members = await memberModel.listAll();
58
+ return members.map((m) => m.userId);
59
+ }
60
+ async function resolveTenantOwners(tenantId) {
61
+ const memberModel = (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId);
62
+ const owners = await memberModel.listOwners();
63
+ return owners.map((m) => m.userId);
64
+ }
65
+ async function notifyTenantMembers(tenantId, subject, payload) {
66
+ await deliverNotification(() => resolveTenantMemberRecipients(tenantId), subject, payload);
67
+ }
68
+ async function notifyTenantOwners(tenantId, subject, payload) {
69
+ await deliverNotification(() => resolveTenantOwners(tenantId), subject, payload);
70
+ }
71
+ async function resolvePlatformOwners(excludeUserId) {
72
+ const userModel = (0, interface_database_decorators_1.GetModel)(db_2.UserModel);
73
+ const rows = await userModel.table
74
+ .filter((user) => user.key("owner").eq(true))
75
+ .run();
76
+ const ids = [];
77
+ for (const row of rows) {
78
+ const user = db_2.UserModel.fromDatabase(row);
79
+ if (user && user._id !== excludeUserId)
80
+ ids.push(user._id);
81
+ }
82
+ return ids;
83
+ }
84
+ async function notifyAllPlatformOwners(subject, payload, excludeUserId) {
85
+ await deliverNotification(() => resolvePlatformOwners(excludeUserId), subject, payload);
86
+ }
87
+ //# sourceMappingURL=recipients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipients.js","sourceRoot":"","sources":["../../src/notifications/recipients.ts"],"names":[],"mappings":";;AA6FA,sEAMC;AAED,kDAIC;AAOD,kDAUC;AAGD,gDAUC;AAED,sDAaC;AAED,0DAUC;AAlKD,gEAA6D;AAC7D,6FAA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AC;AACb,CAAC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,OAAgC,EAChC,OAAgC,EAChC,aAAsB;IAEtB,MAAM,mBAAmB,CACvB,GAAG,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAC1C,OAAO,EACP,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { NotificationSubject } from "@antelopejs/interface-dms/notifications";
2
+ export type NotificationSubjectInfo = ReturnType<typeof NotificationSubject>;
3
+ export declare const SaasCategory: import("@antelopejs/interface-dms/dist/notifications/types").NotificationCategoryInfo;
4
+ export declare const planMigratedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
5
+ export declare const trialEndingSoonSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
6
+ export declare const trialEndedBlockedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
7
+ export declare const paymentFailedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
8
+ export declare const workspaceSuspendedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
9
+ export declare const freeWorkspaceExpiredSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
10
+ export declare const freeWorkspaceEndingSoonSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
11
+ export declare const subscriptionCancelledSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
12
+ export declare const creditNoteIssuedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
13
+ export declare const refundProcessedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
14
+ export declare const platformOwnerAddedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
15
+ export declare const platformOwnerRemovedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
16
+ export declare const workspaceReactivatedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
17
+ export declare const seatOverageSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
18
+ export declare const supportNewMessageSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
19
+ export declare const supportStatusChangedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
20
+ export declare const complimentaryAccessGrantedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
21
+ export declare const automationNotificationSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.automationNotificationSubject = exports.complimentaryAccessGrantedSubject = exports.supportStatusChangedSubject = exports.supportNewMessageSubject = exports.seatOverageSubject = exports.workspaceReactivatedSubject = exports.platformOwnerRemovedSubject = exports.platformOwnerAddedSubject = exports.refundProcessedSubject = exports.creditNoteIssuedSubject = exports.subscriptionCancelledSubject = exports.freeWorkspaceEndingSoonSubject = exports.freeWorkspaceExpiredSubject = exports.workspaceSuspendedSubject = exports.paymentFailedSubject = exports.trialEndedBlockedSubject = exports.trialEndingSoonSubject = exports.planMigratedSubject = exports.SaasCategory = void 0;
4
+ const notifications_1 = require("@antelopejs/interface-dms/notifications");
5
+ exports.SaasCategory = (0, notifications_1.NotificationCategory)("saas", {
6
+ labelKey: "saas.notifications.category.label",
7
+ descriptionKey: "saas.notifications.category.description",
8
+ icon: "i-ph-buildings",
9
+ togglePermission: "default",
10
+ });
11
+ const SUBJECT_KEYS = {
12
+ planMigrated: "saas.notifications.subjects.plan_migrated",
13
+ trialEndingSoon: "saas.notifications.subjects.trial_ending_soon",
14
+ trialEndedBlocked: "saas.notifications.subjects.trial_ended_blocked",
15
+ paymentFailed: "saas.notifications.subjects.payment_failed",
16
+ workspaceSuspended: "saas.notifications.subjects.workspace_suspended",
17
+ subscriptionCancelled: "saas.notifications.subjects.subscription_cancelled",
18
+ creditNoteIssued: "saas.notifications.subjects.credit_note_issued",
19
+ refundProcessed: "saas.notifications.subjects.refund_processed",
20
+ platformOwnerAdded: "saas.notifications.subjects.platform_owner_added",
21
+ platformOwnerRemoved: "saas.notifications.subjects.platform_owner_removed",
22
+ freeWorkspaceExpired: "saas.notifications.subjects.free_workspace_expired",
23
+ freeWorkspaceEndingSoon: "saas.notifications.subjects.free_workspace_ending_soon",
24
+ workspaceReactivated: "saas.notifications.subjects.workspace_reactivated",
25
+ seatOverage: "saas.notifications.subjects.seat_overage",
26
+ supportNewMessage: "saas.notifications.subjects.support_new_message",
27
+ supportStatusChanged: "saas.notifications.subjects.support_status_changed",
28
+ complimentaryAccessGranted: "saas.notifications.subjects.complimentary_access_granted",
29
+ automation: "saas.notifications.subjects.automation",
30
+ };
31
+ exports.planMigratedSubject = (0, notifications_1.NotificationSubject)("saas.plan_migrated", {
32
+ category: exports.SaasCategory,
33
+ labelKey: SUBJECT_KEYS.planMigrated,
34
+ togglePermission: "default",
35
+ });
36
+ exports.trialEndingSoonSubject = (0, notifications_1.NotificationSubject)("saas.trial_ending_soon", {
37
+ category: exports.SaasCategory,
38
+ labelKey: SUBJECT_KEYS.trialEndingSoon,
39
+ togglePermission: "default",
40
+ });
41
+ exports.trialEndedBlockedSubject = (0, notifications_1.NotificationSubject)("saas.trial_ended_blocked", {
42
+ category: exports.SaasCategory,
43
+ labelKey: SUBJECT_KEYS.trialEndedBlocked,
44
+ togglePermission: "forbidden",
45
+ });
46
+ exports.paymentFailedSubject = (0, notifications_1.NotificationSubject)("saas.payment_failed", {
47
+ category: exports.SaasCategory,
48
+ labelKey: SUBJECT_KEYS.paymentFailed,
49
+ togglePermission: "forbidden",
50
+ });
51
+ exports.workspaceSuspendedSubject = (0, notifications_1.NotificationSubject)("saas.workspace_suspended", {
52
+ category: exports.SaasCategory,
53
+ labelKey: SUBJECT_KEYS.workspaceSuspended,
54
+ togglePermission: "forbidden",
55
+ });
56
+ exports.freeWorkspaceExpiredSubject = (0, notifications_1.NotificationSubject)("saas.free_workspace_expired", {
57
+ category: exports.SaasCategory,
58
+ labelKey: SUBJECT_KEYS.freeWorkspaceExpired,
59
+ togglePermission: "forbidden",
60
+ });
61
+ exports.freeWorkspaceEndingSoonSubject = (0, notifications_1.NotificationSubject)("saas.free_workspace_ending_soon", {
62
+ category: exports.SaasCategory,
63
+ labelKey: SUBJECT_KEYS.freeWorkspaceEndingSoon,
64
+ togglePermission: "default",
65
+ });
66
+ exports.subscriptionCancelledSubject = (0, notifications_1.NotificationSubject)("saas.subscription_cancelled", {
67
+ category: exports.SaasCategory,
68
+ labelKey: SUBJECT_KEYS.subscriptionCancelled,
69
+ togglePermission: "forbidden",
70
+ });
71
+ exports.creditNoteIssuedSubject = (0, notifications_1.NotificationSubject)("saas.credit_note_issued", {
72
+ category: exports.SaasCategory,
73
+ labelKey: SUBJECT_KEYS.creditNoteIssued,
74
+ togglePermission: "default",
75
+ });
76
+ exports.refundProcessedSubject = (0, notifications_1.NotificationSubject)("saas.refund_processed", {
77
+ category: exports.SaasCategory,
78
+ labelKey: SUBJECT_KEYS.refundProcessed,
79
+ togglePermission: "default",
80
+ });
81
+ exports.platformOwnerAddedSubject = (0, notifications_1.NotificationSubject)("saas.platform_owner_added", {
82
+ category: exports.SaasCategory,
83
+ labelKey: SUBJECT_KEYS.platformOwnerAdded,
84
+ togglePermission: "default",
85
+ });
86
+ exports.platformOwnerRemovedSubject = (0, notifications_1.NotificationSubject)("saas.platform_owner_removed", {
87
+ category: exports.SaasCategory,
88
+ labelKey: SUBJECT_KEYS.platformOwnerRemoved,
89
+ togglePermission: "default",
90
+ });
91
+ exports.workspaceReactivatedSubject = (0, notifications_1.NotificationSubject)("saas.workspace_reactivated", {
92
+ category: exports.SaasCategory,
93
+ labelKey: SUBJECT_KEYS.workspaceReactivated,
94
+ togglePermission: "default",
95
+ });
96
+ exports.seatOverageSubject = (0, notifications_1.NotificationSubject)("saas.seat_overage", {
97
+ category: exports.SaasCategory,
98
+ labelKey: SUBJECT_KEYS.seatOverage,
99
+ togglePermission: "default",
100
+ });
101
+ exports.supportNewMessageSubject = (0, notifications_1.NotificationSubject)("saas.support_new_message", {
102
+ category: exports.SaasCategory,
103
+ labelKey: SUBJECT_KEYS.supportNewMessage,
104
+ togglePermission: "default",
105
+ });
106
+ exports.supportStatusChangedSubject = (0, notifications_1.NotificationSubject)("saas.support_status_changed", {
107
+ category: exports.SaasCategory,
108
+ labelKey: SUBJECT_KEYS.supportStatusChanged,
109
+ togglePermission: "default",
110
+ });
111
+ exports.complimentaryAccessGrantedSubject = (0, notifications_1.NotificationSubject)("saas.complimentary_access_granted", {
112
+ category: exports.SaasCategory,
113
+ labelKey: SUBJECT_KEYS.complimentaryAccessGranted,
114
+ togglePermission: "default",
115
+ });
116
+ exports.automationNotificationSubject = (0, notifications_1.NotificationSubject)("saas.automation", {
117
+ category: exports.SaasCategory,
118
+ labelKey: SUBJECT_KEYS.automation,
119
+ togglePermission: "default",
120
+ });
121
+ //# sourceMappingURL=subjects.js.map