@antelopejs/dms-saas 0.3.15 → 0.5.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 (819) hide show
  1. package/README.md +61 -14
  2. package/dist/auth/index.d.ts +1 -0
  3. package/dist/auth/index.js +1 -0
  4. package/dist/auth/index.js.map +1 -1
  5. package/dist/auth/owner-only-permissions-resolver.d.ts +1 -0
  6. package/dist/auth/owner-only-permissions-resolver.js +25 -0
  7. package/dist/auth/owner-only-permissions-resolver.js.map +1 -0
  8. package/dist/billing-state/directory-hooks.d.ts +1 -0
  9. package/dist/billing-state/directory-hooks.js +35 -0
  10. package/dist/billing-state/directory-hooks.js.map +1 -0
  11. package/dist/billing-state/directory.d.ts +29 -0
  12. package/dist/billing-state/directory.js +152 -0
  13. package/dist/billing-state/directory.js.map +1 -0
  14. package/dist/billing-state/index.d.ts +5 -1
  15. package/dist/billing-state/index.js +14 -2
  16. package/dist/billing-state/index.js.map +1 -1
  17. package/dist/billing-state/past-due-banner.d.ts +4 -3
  18. package/dist/billing-state/past-due-banner.js +30 -10
  19. package/dist/billing-state/past-due-banner.js.map +1 -1
  20. package/dist/billing-state/recovery.d.ts +4 -0
  21. package/dist/billing-state/recovery.js +7 -5
  22. package/dist/billing-state/recovery.js.map +1 -1
  23. package/dist/billing-state/trial-ending-banner.d.ts +4 -0
  24. package/dist/billing-state/trial-ending-banner.js +66 -0
  25. package/dist/billing-state/trial-ending-banner.js.map +1 -0
  26. package/dist/config/runtime.d.ts +1 -0
  27. package/dist/config/runtime.js +5 -0
  28. package/dist/config/runtime.js.map +1 -1
  29. package/dist/crons/auto-suspend-past-due.js +4 -5
  30. package/dist/crons/auto-suspend-past-due.js.map +1 -1
  31. package/dist/data-api/platformOwner/admin-user-invoices.d.ts +6 -4
  32. package/dist/data-api/platformOwner/admin-user-invoices.js +52 -30
  33. package/dist/data-api/platformOwner/admin-user-invoices.js.map +1 -1
  34. package/dist/data-api/platformOwner/admin-user-workspaces.d.ts +2 -0
  35. package/dist/data-api/platformOwner/admin-user-workspaces.js +69 -3
  36. package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -1
  37. package/dist/data-api/platformOwner/credit-note-rows.d.ts +11 -0
  38. package/dist/data-api/platformOwner/credit-note-rows.js +54 -0
  39. package/dist/data-api/platformOwner/credit-note-rows.js.map +1 -0
  40. package/dist/data-api/platformOwner/credit-notes.d.ts +13 -0
  41. package/dist/data-api/platformOwner/credit-notes.js +149 -10
  42. package/dist/data-api/platformOwner/credit-notes.js.map +1 -1
  43. package/dist/data-api/platformOwner/features.d.ts +8 -2
  44. package/dist/data-api/platformOwner/features.js +155 -35
  45. package/dist/data-api/platformOwner/features.js.map +1 -1
  46. package/dist/data-api/platformOwner/invitations.js +29 -9
  47. package/dist/data-api/platformOwner/invitations.js.map +1 -1
  48. package/dist/data-api/platformOwner/invoice-cells.d.ts +5 -0
  49. package/dist/data-api/platformOwner/invoice-cells.js +51 -0
  50. package/dist/data-api/platformOwner/invoice-cells.js.map +1 -0
  51. package/dist/data-api/platformOwner/invoice-options.js.map +1 -1
  52. package/dist/data-api/platformOwner/invoice-rows.d.ts +9 -0
  53. package/dist/data-api/platformOwner/invoice-rows.js +39 -0
  54. package/dist/data-api/platformOwner/invoice-rows.js.map +1 -0
  55. package/dist/data-api/platformOwner/invoices.d.ts +24 -6
  56. package/dist/data-api/platformOwner/invoices.js +192 -11
  57. package/dist/data-api/platformOwner/invoices.js.map +1 -1
  58. package/dist/data-api/platformOwner/members.d.ts +2 -1
  59. package/dist/data-api/platformOwner/members.js +56 -20
  60. package/dist/data-api/platformOwner/members.js.map +1 -1
  61. package/dist/data-api/platformOwner/plan-migrations.d.ts +14 -2
  62. package/dist/data-api/platformOwner/plan-migrations.js +179 -33
  63. package/dist/data-api/platformOwner/plan-migrations.js.map +1 -1
  64. package/dist/data-api/platformOwner/plans.d.ts +30 -6
  65. package/dist/data-api/platformOwner/plans.js +269 -44
  66. package/dist/data-api/platformOwner/plans.js.map +1 -1
  67. package/dist/data-api/platformOwner/segments.d.ts +9 -7
  68. package/dist/data-api/platformOwner/segments.js +108 -101
  69. package/dist/data-api/platformOwner/segments.js.map +1 -1
  70. package/dist/data-api/platformOwner/table-scope.d.ts +6 -0
  71. package/dist/data-api/platformOwner/table-scope.js +8 -0
  72. package/dist/data-api/platformOwner/table-scope.js.map +1 -0
  73. package/dist/data-api/platformOwner/users.d.ts +15 -2
  74. package/dist/data-api/platformOwner/users.js +171 -15
  75. package/dist/data-api/platformOwner/users.js.map +1 -1
  76. package/dist/data-api/platformOwner/workspace-cells.d.ts +12 -0
  77. package/dist/data-api/platformOwner/workspace-cells.js +90 -0
  78. package/dist/data-api/platformOwner/workspace-cells.js.map +1 -0
  79. package/dist/data-api/platformOwner/workspaces.d.ts +26 -4
  80. package/dist/data-api/platformOwner/workspaces.js +269 -97
  81. package/dist/data-api/platformOwner/workspaces.js.map +1 -1
  82. package/dist/data-api/tenant/tenant-invoices.d.ts +4 -0
  83. package/dist/data-api/tenant/tenant-invoices.js +68 -4
  84. package/dist/data-api/tenant/tenant-invoices.js.map +1 -1
  85. package/dist/hooks/register.js +5 -1
  86. package/dist/hooks/register.js.map +1 -1
  87. package/dist/i18n/composed-text.d.ts +17 -0
  88. package/dist/i18n/composed-text.js +71 -0
  89. package/dist/i18n/composed-text.js.map +1 -0
  90. package/dist/implementations/dms-saas/billing.d.ts +1 -0
  91. package/dist/implementations/dms-saas/billing.js +4 -1
  92. package/dist/implementations/dms-saas/billing.js.map +1 -1
  93. package/dist/implementations/dms-saas/pages.d.ts +0 -1
  94. package/dist/implementations/dms-saas/pages.js +0 -4
  95. package/dist/implementations/dms-saas/pages.js.map +1 -1
  96. package/dist/index.js +5 -1
  97. package/dist/index.js.map +1 -1
  98. package/dist/metrics/activity-sources.d.ts +2 -0
  99. package/dist/metrics/activity-sources.js +60 -0
  100. package/dist/metrics/activity-sources.js.map +1 -0
  101. package/dist/metrics/activity.d.ts +25 -0
  102. package/dist/metrics/activity.js +197 -0
  103. package/dist/metrics/activity.js.map +1 -0
  104. package/dist/metrics/directory-summary.d.ts +30 -0
  105. package/dist/metrics/directory-summary.js +95 -0
  106. package/dist/metrics/directory-summary.js.map +1 -0
  107. package/dist/metrics/headline-items.d.ts +32 -0
  108. package/dist/metrics/headline-items.js +242 -0
  109. package/dist/metrics/headline-items.js.map +1 -0
  110. package/dist/metrics/normalised-mrr.d.ts +32 -0
  111. package/dist/metrics/normalised-mrr.js +75 -0
  112. package/dist/metrics/normalised-mrr.js.map +1 -0
  113. package/dist/metrics/revenue.d.ts +30 -0
  114. package/dist/metrics/revenue.js +126 -0
  115. package/dist/metrics/revenue.js.map +1 -0
  116. package/dist/notifications/recipients.d.ts +1 -0
  117. package/dist/notifications/recipients.js +4 -0
  118. package/dist/notifications/recipients.js.map +1 -1
  119. package/dist/notifications/subjects.d.ts +18 -17
  120. package/dist/notifications/subjects.js +7 -1
  121. package/dist/notifications/subjects.js.map +1 -1
  122. package/dist/operator-actions/commands.js +9 -6
  123. package/dist/operator-actions/commands.js.map +1 -1
  124. package/dist/operator-actions/invitation-commands.d.ts +7 -1
  125. package/dist/operator-actions/invitation-commands.js +16 -0
  126. package/dist/operator-actions/invitation-commands.js.map +1 -1
  127. package/dist/operator-actions/previews.d.ts +50 -0
  128. package/dist/operator-actions/previews.js +113 -0
  129. package/dist/operator-actions/previews.js.map +1 -0
  130. package/dist/operator-actions/types.d.ts +1 -1
  131. package/dist/operator-actions/upgrade-preview.d.ts +35 -0
  132. package/dist/operator-actions/upgrade-preview.js +110 -0
  133. package/dist/operator-actions/upgrade-preview.js.map +1 -0
  134. package/dist/operator-billing/billing-rules.d.ts +58 -0
  135. package/dist/operator-billing/billing-rules.js +90 -0
  136. package/dist/operator-billing/billing-rules.js.map +1 -0
  137. package/dist/operator-billing/billing-settings-store.d.ts +3 -0
  138. package/dist/operator-billing/billing-settings-store.js +34 -0
  139. package/dist/operator-billing/billing-settings-store.js.map +1 -0
  140. package/dist/operator-billing/billing-stats.d.ts +37 -0
  141. package/dist/operator-billing/billing-stats.js +197 -0
  142. package/dist/operator-billing/billing-stats.js.map +1 -0
  143. package/dist/operator-billing/credit-allowance.d.ts +17 -0
  144. package/dist/operator-billing/credit-allowance.js +44 -0
  145. package/dist/operator-billing/credit-allowance.js.map +1 -0
  146. package/dist/operator-billing/credit-note-request.d.ts +39 -0
  147. package/dist/operator-billing/credit-note-request.js +73 -0
  148. package/dist/operator-billing/credit-note-request.js.map +1 -0
  149. package/dist/operator-billing/index.d.ts +8 -0
  150. package/dist/operator-billing/index.js +25 -0
  151. package/dist/operator-billing/index.js.map +1 -0
  152. package/dist/operator-billing/invoice-credit.d.ts +41 -0
  153. package/dist/operator-billing/invoice-credit.js +111 -0
  154. package/dist/operator-billing/invoice-credit.js.map +1 -0
  155. package/dist/operator-billing/legal-documents-store.d.ts +12 -0
  156. package/dist/operator-billing/legal-documents-store.js +46 -0
  157. package/dist/operator-billing/legal-documents-store.js.map +1 -0
  158. package/dist/operator-billing/legal-versions.d.ts +5 -0
  159. package/dist/operator-billing/legal-versions.js +31 -0
  160. package/dist/operator-billing/legal-versions.js.map +1 -0
  161. package/dist/pages/block-meta.d.ts +15 -0
  162. package/dist/pages/block-meta.js +21 -0
  163. package/dist/pages/block-meta.js.map +1 -0
  164. package/dist/pages/module.d.ts +1 -3
  165. package/dist/pages/module.js +1 -8
  166. package/dist/pages/module.js.map +1 -1
  167. package/dist/pages/platform/credit-notes.d.ts +1 -0
  168. package/dist/pages/platform/credit-notes.js +63 -5
  169. package/dist/pages/platform/credit-notes.js.map +1 -1
  170. package/dist/pages/platform/dashboard.d.ts +4 -1
  171. package/dist/pages/platform/dashboard.js +123 -64
  172. package/dist/pages/platform/dashboard.js.map +1 -1
  173. package/dist/pages/platform/features.js +83 -12
  174. package/dist/pages/platform/features.js.map +1 -1
  175. package/dist/pages/platform/index.d.ts +1 -0
  176. package/dist/pages/platform/index.js +1 -0
  177. package/dist/pages/platform/index.js.map +1 -1
  178. package/dist/pages/platform/invoices.d.ts +6 -0
  179. package/dist/pages/platform/invoices.js +84 -28
  180. package/dist/pages/platform/invoices.js.map +1 -1
  181. package/dist/pages/platform/paths.d.ts +9 -0
  182. package/dist/pages/platform/paths.js +25 -0
  183. package/dist/pages/platform/paths.js.map +1 -0
  184. package/dist/pages/platform/plans/edit.d.ts +2 -2
  185. package/dist/pages/platform/plans/edit.js +170 -105
  186. package/dist/pages/platform/plans/edit.js.map +1 -1
  187. package/dist/pages/platform/plans/index.d.ts +1 -0
  188. package/dist/pages/platform/plans/index.js +172 -54
  189. package/dist/pages/platform/plans/index.js.map +1 -1
  190. package/dist/pages/platform/plans/migrations.d.ts +12 -0
  191. package/dist/pages/platform/plans/migrations.js +259 -13
  192. package/dist/pages/platform/plans/migrations.js.map +1 -1
  193. package/dist/pages/platform/segments/edit.d.ts +17 -0
  194. package/dist/pages/platform/segments/edit.js +124 -0
  195. package/dist/pages/platform/segments/edit.js.map +1 -0
  196. package/dist/pages/platform/segments/index.js +68 -8
  197. package/dist/pages/platform/segments/index.js.map +1 -1
  198. package/dist/pages/platform/settings.d.ts +1 -1
  199. package/dist/pages/platform/settings.js +164 -105
  200. package/dist/pages/platform/settings.js.map +1 -1
  201. package/dist/pages/platform/users/detail.js +104 -33
  202. package/dist/pages/platform/users/detail.js.map +1 -1
  203. package/dist/pages/platform/users/index.js +52 -18
  204. package/dist/pages/platform/users/index.js.map +1 -1
  205. package/dist/pages/platform/workspaces/detail.d.ts +3 -1
  206. package/dist/pages/platform/workspaces/detail.js +184 -113
  207. package/dist/pages/platform/workspaces/detail.js.map +1 -1
  208. package/dist/pages/platform/workspaces/index.d.ts +1 -20
  209. package/dist/pages/platform/workspaces/index.js +152 -180
  210. package/dist/pages/platform/workspaces/index.js.map +1 -1
  211. package/dist/pages/platform/workspaces/shared.d.ts +11 -0
  212. package/dist/pages/platform/workspaces/shared.js +53 -0
  213. package/dist/pages/platform/workspaces/shared.js.map +1 -0
  214. package/dist/pages/public/auth/no-workspace.js +7 -2
  215. package/dist/pages/public/auth/no-workspace.js.map +1 -1
  216. package/dist/pages/public/index.js.map +1 -1
  217. package/dist/pages/public/legal/privacy-policy.d.ts +1 -0
  218. package/dist/pages/public/legal/privacy-policy.js +9 -4
  219. package/dist/pages/public/legal/privacy-policy.js.map +1 -1
  220. package/dist/pages/public/legal/terms-and-conditions.d.ts +1 -0
  221. package/dist/pages/public/legal/terms-and-conditions.js +9 -4
  222. package/dist/pages/public/legal/terms-and-conditions.js.map +1 -1
  223. package/dist/pages/public/legal/terms-of-use.d.ts +1 -0
  224. package/dist/pages/public/legal/terms-of-use.js +9 -4
  225. package/dist/pages/public/legal/terms-of-use.js.map +1 -1
  226. package/dist/pages/public/nav-bar.d.ts +2 -0
  227. package/dist/pages/public/nav-bar.js +14 -0
  228. package/dist/pages/public/nav-bar.js.map +1 -0
  229. package/dist/pages/public/pricing.d.ts +10 -0
  230. package/dist/pages/public/pricing.js +32 -0
  231. package/dist/pages/public/pricing.js.map +1 -0
  232. package/dist/pages/public/register.d.ts +1 -0
  233. package/dist/pages/public/register.js +6 -3
  234. package/dist/pages/public/register.js.map +1 -1
  235. package/dist/pages/public/screens.js +1 -0
  236. package/dist/pages/public/screens.js.map +1 -1
  237. package/dist/pages/tenant/billing.d.ts +7 -7
  238. package/dist/pages/tenant/billing.js +141 -63
  239. package/dist/pages/tenant/billing.js.map +1 -1
  240. package/dist/pages/tenant/data-export.d.ts +3 -1
  241. package/dist/pages/tenant/data-export.js +25 -6
  242. package/dist/pages/tenant/data-export.js.map +1 -1
  243. package/dist/pages/tenant/general.d.ts +3 -2
  244. package/dist/pages/tenant/general.js +91 -11
  245. package/dist/pages/tenant/general.js.map +1 -1
  246. package/dist/pages/tenant/index.d.ts +1 -0
  247. package/dist/pages/tenant/index.js +1 -0
  248. package/dist/pages/tenant/index.js.map +1 -1
  249. package/dist/pages/tenant/members-seat-quota.d.ts +3 -0
  250. package/dist/pages/tenant/members-seat-quota.js +18 -6
  251. package/dist/pages/tenant/members-seat-quota.js.map +1 -1
  252. package/dist/pages/tenant/owner-only.d.ts +1 -0
  253. package/dist/pages/tenant/owner-only.js +14 -0
  254. package/dist/pages/tenant/owner-only.js.map +1 -0
  255. package/dist/pages/tenant/workspace-suspended.js +7 -3
  256. package/dist/pages/tenant/workspace-suspended.js.map +1 -1
  257. package/dist/plan-changes/applied-upgrade.d.ts +5 -0
  258. package/dist/plan-changes/applied-upgrade.js +51 -0
  259. package/dist/plan-changes/applied-upgrade.js.map +1 -0
  260. package/dist/plan-changes/deferred.js +9 -40
  261. package/dist/plan-changes/deferred.js.map +1 -1
  262. package/dist/plan-changes/immediate.d.ts +4 -0
  263. package/dist/plan-changes/immediate.js +34 -0
  264. package/dist/plan-changes/immediate.js.map +1 -0
  265. package/dist/plan-changes/index.d.ts +1 -0
  266. package/dist/plan-changes/index.js +1 -0
  267. package/dist/plan-changes/index.js.map +1 -1
  268. package/dist/plan-changes/pending-target.d.ts +17 -0
  269. package/dist/plan-changes/pending-target.js +62 -0
  270. package/dist/plan-changes/pending-target.js.map +1 -0
  271. package/dist/plans/catalogue-summary.d.ts +24 -0
  272. package/dist/plans/catalogue-summary.js +97 -0
  273. package/dist/plans/catalogue-summary.js.map +1 -0
  274. package/dist/plans/catalogue-usage.d.ts +36 -0
  275. package/dist/plans/catalogue-usage.js +120 -0
  276. package/dist/plans/catalogue-usage.js.map +1 -0
  277. package/dist/plans/feature-guards.d.ts +5 -0
  278. package/dist/plans/feature-guards.js +31 -0
  279. package/dist/plans/feature-guards.js.map +1 -0
  280. package/dist/plans/feature-usage.d.ts +4 -0
  281. package/dist/plans/feature-usage.js +22 -0
  282. package/dist/plans/feature-usage.js.map +1 -0
  283. package/dist/plans/migration-blocks.d.ts +13 -0
  284. package/dist/plans/migration-blocks.js +337 -0
  285. package/dist/plans/migration-blocks.js.map +1 -0
  286. package/dist/plans/migration-detail.d.ts +48 -0
  287. package/dist/plans/migration-detail.js +80 -0
  288. package/dist/plans/migration-detail.js.map +1 -0
  289. package/dist/plans/migration-dialogs.d.ts +8 -0
  290. package/dist/plans/migration-dialogs.js +103 -0
  291. package/dist/plans/migration-dialogs.js.map +1 -0
  292. package/dist/plans/migration-outcomes.d.ts +7 -0
  293. package/dist/plans/migration-outcomes.js +38 -0
  294. package/dist/plans/migration-outcomes.js.map +1 -0
  295. package/dist/plans/migration-realtime.d.ts +2 -0
  296. package/dist/plans/migration-realtime.js +19 -0
  297. package/dist/plans/migration-realtime.js.map +1 -0
  298. package/dist/plans/migration-workspaces.d.ts +40 -0
  299. package/dist/plans/migration-workspaces.js +121 -0
  300. package/dist/plans/migration-workspaces.js.map +1 -0
  301. package/dist/plans/money.d.ts +1 -0
  302. package/dist/plans/money.js +11 -0
  303. package/dist/plans/money.js.map +1 -0
  304. package/dist/plans/plan-access-type.d.ts +25 -0
  305. package/dist/plans/plan-access-type.js +49 -0
  306. package/dist/plans/plan-access-type.js.map +1 -0
  307. package/dist/plans/plan-audience.d.ts +3 -0
  308. package/dist/plans/plan-audience.js +9 -0
  309. package/dist/plans/plan-audience.js.map +1 -0
  310. package/dist/plans/plan-diff.d.ts +13 -0
  311. package/dist/plans/plan-diff.js +73 -0
  312. package/dist/plans/plan-diff.js.map +1 -0
  313. package/dist/plans/plan-permission-tree.d.ts +11 -0
  314. package/dist/plans/plan-permission-tree.js +58 -0
  315. package/dist/plans/plan-permission-tree.js.map +1 -0
  316. package/dist/plans/plan-write.d.ts +17 -0
  317. package/dist/plans/plan-write.js +111 -0
  318. package/dist/plans/plan-write.js.map +1 -0
  319. package/dist/plans/seat-capacity.d.ts +3 -1
  320. package/dist/plans/seat-capacity.js +10 -2
  321. package/dist/plans/seat-capacity.js.map +1 -1
  322. package/dist/plans/seat-hooks.d.ts +1 -0
  323. package/dist/plans/seat-hooks.js +1 -0
  324. package/dist/plans/seat-hooks.js.map +1 -1
  325. package/dist/plans/stripe-sync.d.ts +3 -0
  326. package/dist/plans/stripe-sync.js +16 -0
  327. package/dist/plans/stripe-sync.js.map +1 -1
  328. package/dist/routes/platformOwner/billing-settings.d.ts +11 -35
  329. package/dist/routes/platformOwner/billing-settings.js +77 -47
  330. package/dist/routes/platformOwner/billing-settings.js.map +1 -1
  331. package/dist/routes/platformOwner/billing-stats.d.ts +15 -0
  332. package/dist/routes/platformOwner/billing-stats.js +106 -0
  333. package/dist/routes/platformOwner/billing-stats.js.map +1 -0
  334. package/dist/routes/platformOwner/block-payloads.d.ts +7 -0
  335. package/dist/routes/platformOwner/block-payloads.js +3 -0
  336. package/dist/routes/platformOwner/block-payloads.js.map +1 -0
  337. package/dist/routes/platformOwner/credit-notes-issue.d.ts +7 -8
  338. package/dist/routes/platformOwner/credit-notes-issue.js +28 -16
  339. package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -1
  340. package/dist/routes/platformOwner/dashboard.d.ts +14 -57
  341. package/dist/routes/platformOwner/dashboard.js +126 -247
  342. package/dist/routes/platformOwner/dashboard.js.map +1 -1
  343. package/dist/routes/platformOwner/index.d.ts +7 -0
  344. package/dist/routes/platformOwner/index.js +7 -0
  345. package/dist/routes/platformOwner/index.js.map +1 -1
  346. package/dist/routes/platformOwner/plan-deletion.d.ts +77 -19
  347. package/dist/routes/platformOwner/plan-deletion.js +219 -67
  348. package/dist/routes/platformOwner/plan-deletion.js.map +1 -1
  349. package/dist/routes/platformOwner/plan-dialogs.d.ts +22 -0
  350. package/dist/routes/platformOwner/plan-dialogs.js +211 -0
  351. package/dist/routes/platformOwner/plan-dialogs.js.map +1 -0
  352. package/dist/routes/platformOwner/plan-migration-context.d.ts +9 -0
  353. package/dist/routes/platformOwner/plan-migration-context.js +147 -0
  354. package/dist/routes/platformOwner/plan-migration-context.js.map +1 -0
  355. package/dist/routes/platformOwner/plan-migration-export.d.ts +12 -0
  356. package/dist/routes/platformOwner/plan-migration-export.js +100 -0
  357. package/dist/routes/platformOwner/plan-migration-export.js.map +1 -0
  358. package/dist/routes/platformOwner/plan-migrations.d.ts +43 -0
  359. package/dist/routes/platformOwner/plan-migrations.js +260 -0
  360. package/dist/routes/platformOwner/plan-migrations.js.map +1 -0
  361. package/dist/routes/platformOwner/plans.d.ts +45 -42
  362. package/dist/routes/platformOwner/plans.js +162 -143
  363. package/dist/routes/platformOwner/plans.js.map +1 -1
  364. package/dist/routes/platformOwner/platform-owners.d.ts +8 -6
  365. package/dist/routes/platformOwner/platform-owners.js +40 -12
  366. package/dist/routes/platformOwner/platform-owners.js.map +1 -1
  367. package/dist/routes/platformOwner/segments-export.d.ts +15 -0
  368. package/dist/routes/platformOwner/segments-export.js +143 -0
  369. package/dist/routes/platformOwner/segments-export.js.map +1 -0
  370. package/dist/routes/platformOwner/segments.d.ts +17 -11
  371. package/dist/routes/platformOwner/segments.js +62 -113
  372. package/dist/routes/platformOwner/segments.js.map +1 -1
  373. package/dist/routes/platformOwner/stripe-dashboard.d.ts +6 -0
  374. package/dist/routes/platformOwner/stripe-dashboard.js +29 -0
  375. package/dist/routes/platformOwner/stripe-dashboard.js.map +1 -0
  376. package/dist/routes/platformOwner/users-detail.d.ts +12 -22
  377. package/dist/routes/platformOwner/users-detail.js +60 -53
  378. package/dist/routes/platformOwner/users-detail.js.map +1 -1
  379. package/dist/routes/platformOwner/workspace-detail.d.ts +36 -0
  380. package/dist/routes/platformOwner/workspace-detail.js +222 -0
  381. package/dist/routes/platformOwner/workspace-detail.js.map +1 -0
  382. package/dist/routes/platformOwner/workspace-invitations.d.ts +4 -0
  383. package/dist/routes/platformOwner/workspace-invitations.js +18 -0
  384. package/dist/routes/platformOwner/workspace-invitations.js.map +1 -1
  385. package/dist/routes/platformOwner/workspace-operator-actions.d.ts +14 -2
  386. package/dist/routes/platformOwner/workspace-operator-actions.js +42 -4
  387. package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
  388. package/dist/routes/platformOwner/workspaces-admin.d.ts +17 -12
  389. package/dist/routes/platformOwner/workspaces-admin.js +122 -28
  390. package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
  391. package/dist/routes/public/index.d.ts +1 -0
  392. package/dist/routes/public/index.js +1 -0
  393. package/dist/routes/public/index.js.map +1 -1
  394. package/dist/routes/public/legal-documents.d.ts +2 -8
  395. package/dist/routes/public/legal-documents.js +4 -39
  396. package/dist/routes/public/legal-documents.js.map +1 -1
  397. package/dist/routes/public/pricing.d.ts +12 -0
  398. package/dist/routes/public/pricing.js +50 -0
  399. package/dist/routes/public/pricing.js.map +1 -0
  400. package/dist/routes/public/public-plan-catalog.d.ts +37 -0
  401. package/dist/routes/public/public-plan-catalog.js +63 -0
  402. package/dist/routes/public/public-plan-catalog.js.map +1 -0
  403. package/dist/routes/public/register.d.ts +13 -0
  404. package/dist/routes/public/register.js +88 -4
  405. package/dist/routes/public/register.js.map +1 -1
  406. package/dist/routes/tenant/billing-pay-invoice.d.ts +13 -0
  407. package/dist/routes/tenant/billing-pay-invoice.js +82 -0
  408. package/dist/routes/tenant/billing-pay-invoice.js.map +1 -0
  409. package/dist/routes/tenant/billing-portal.d.ts +8 -3
  410. package/dist/routes/tenant/billing-portal.js +34 -16
  411. package/dist/routes/tenant/billing-portal.js.map +1 -1
  412. package/dist/routes/tenant/billing-self-refund.d.ts +26 -1
  413. package/dist/routes/tenant/billing-self-refund.js +95 -46
  414. package/dist/routes/tenant/billing-self-refund.js.map +1 -1
  415. package/dist/routes/tenant/complimentary-banner.d.ts +12 -0
  416. package/dist/routes/tenant/complimentary-banner.js +64 -0
  417. package/dist/routes/tenant/complimentary-banner.js.map +1 -0
  418. package/dist/routes/tenant/data-export.js +14 -0
  419. package/dist/routes/tenant/data-export.js.map +1 -1
  420. package/dist/routes/tenant/index.d.ts +7 -0
  421. package/dist/routes/tenant/index.js +7 -0
  422. package/dist/routes/tenant/index.js.map +1 -1
  423. package/dist/routes/tenant/tenant-billing.d.ts +1 -0
  424. package/dist/routes/tenant/tenant-billing.js +18 -13
  425. package/dist/routes/tenant/tenant-billing.js.map +1 -1
  426. package/dist/routes/tenant/tenant-plan-authentication.d.ts +13 -0
  427. package/dist/routes/tenant/tenant-plan-authentication.js +79 -0
  428. package/dist/routes/tenant/tenant-plan-authentication.js.map +1 -0
  429. package/dist/routes/tenant/tenant-plan-cancellation.d.ts +12 -0
  430. package/dist/routes/tenant/tenant-plan-cancellation.js +87 -0
  431. package/dist/routes/tenant/tenant-plan-cancellation.js.map +1 -0
  432. package/dist/routes/tenant/tenant-plan-checkout.d.ts +3 -0
  433. package/dist/routes/tenant/tenant-plan-checkout.js +21 -11
  434. package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
  435. package/dist/routes/tenant/tenant-plan-ops.d.ts +32 -2
  436. package/dist/routes/tenant/tenant-plan-ops.js +112 -39
  437. package/dist/routes/tenant/tenant-plan-ops.js.map +1 -1
  438. package/dist/routes/tenant/tenant-plan-preview.d.ts +33 -0
  439. package/dist/routes/tenant/tenant-plan-preview.js +216 -0
  440. package/dist/routes/tenant/tenant-plan-preview.js.map +1 -0
  441. package/dist/routes/tenant/tenant-plan-resubscription.d.ts +2 -0
  442. package/dist/routes/tenant/tenant-plan-resubscription.js +61 -0
  443. package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -0
  444. package/dist/routes/tenant/tenant-plan.d.ts +9 -4
  445. package/dist/routes/tenant/tenant-plan.js +125 -15
  446. package/dist/routes/tenant/tenant-plan.js.map +1 -1
  447. package/dist/routes/tenant/tenant-seats.d.ts +6 -1
  448. package/dist/routes/tenant/tenant-seats.js +26 -5
  449. package/dist/routes/tenant/tenant-seats.js.map +1 -1
  450. package/dist/routes/tenant/tenant-upcoming-invoice.d.ts +26 -0
  451. package/dist/routes/tenant/tenant-upcoming-invoice.js +200 -0
  452. package/dist/routes/tenant/tenant-upcoming-invoice.js.map +1 -0
  453. package/dist/routes/tenant/workspace-access.d.ts +67 -0
  454. package/dist/routes/tenant/workspace-access.js +224 -0
  455. package/dist/routes/tenant/workspace-access.js.map +1 -0
  456. package/dist/routes/tenant/workspaces.d.ts +12 -43
  457. package/dist/routes/tenant/workspaces.js +82 -192
  458. package/dist/routes/tenant/workspaces.js.map +1 -1
  459. package/dist/segments/index.d.ts +29 -0
  460. package/dist/segments/index.js +116 -0
  461. package/dist/segments/index.js.map +1 -0
  462. package/dist/stripe/client.d.ts +1 -0
  463. package/dist/stripe/client.js +11 -0
  464. package/dist/stripe/client.js.map +1 -1
  465. package/dist/stripe/customer-locale.d.ts +3 -0
  466. package/dist/stripe/customer-locale.js +36 -0
  467. package/dist/stripe/customer-locale.js.map +1 -0
  468. package/dist/stripe/dashboard-links.d.ts +2 -0
  469. package/dist/stripe/dashboard-links.js +8 -0
  470. package/dist/stripe/dashboard-links.js.map +1 -0
  471. package/dist/stripe/index.d.ts +3 -0
  472. package/dist/stripe/index.js +3 -0
  473. package/dist/stripe/index.js.map +1 -1
  474. package/dist/stripe/pending-update.d.ts +5 -0
  475. package/dist/stripe/pending-update.js +56 -0
  476. package/dist/stripe/pending-update.js.map +1 -0
  477. package/dist/stripe/plan-schedule.js +4 -1
  478. package/dist/stripe/plan-schedule.js.map +1 -1
  479. package/dist/stripe/subscription-cancellation.d.ts +3 -0
  480. package/dist/stripe/subscription-cancellation.js +26 -0
  481. package/dist/stripe/subscription-cancellation.js.map +1 -0
  482. package/dist/stripe/sync-plan.js +5 -6
  483. package/dist/stripe/sync-plan.js.map +1 -1
  484. package/dist/stripe/upcoming-invoice.d.ts +9 -0
  485. package/dist/stripe/upcoming-invoice.js +19 -3
  486. package/dist/stripe/upcoming-invoice.js.map +1 -1
  487. package/dist/stripe/webhook-checkout.js +2 -0
  488. package/dist/stripe/webhook-checkout.js.map +1 -1
  489. package/dist/stripe/webhook-credit-notes.js +15 -0
  490. package/dist/stripe/webhook-credit-notes.js.map +1 -1
  491. package/dist/stripe/webhook-dispatch.js +2 -0
  492. package/dist/stripe/webhook-dispatch.js.map +1 -1
  493. package/dist/stripe/webhook-handlers.d.ts +1 -0
  494. package/dist/stripe/webhook-handlers.js +34 -9
  495. package/dist/stripe/webhook-handlers.js.map +1 -1
  496. package/dist/stripe/webhook-shared.d.ts +3 -1
  497. package/dist/stripe/webhook-shared.js +20 -1
  498. package/dist/stripe/webhook-shared.js.map +1 -1
  499. package/dist/stripe/workspace-checkout.d.ts +2 -0
  500. package/dist/stripe/workspace-checkout.js +4 -0
  501. package/dist/stripe/workspace-checkout.js.map +1 -1
  502. package/dist/types/config.d.ts +2 -0
  503. package/dist/types/config.js.map +1 -1
  504. package/dist/upcoming-invoice/mapping.js +1 -0
  505. package/dist/upcoming-invoice/mapping.js.map +1 -1
  506. package/dist/users/index.d.ts +4 -0
  507. package/dist/users/index.js +21 -0
  508. package/dist/users/index.js.map +1 -0
  509. package/dist/users/platform-role.d.ts +18 -0
  510. package/dist/users/platform-role.js +127 -0
  511. package/dist/users/platform-role.js.map +1 -0
  512. package/dist/users/user-detail.d.ts +43 -0
  513. package/dist/users/user-detail.js +100 -0
  514. package/dist/users/user-detail.js.map +1 -0
  515. package/dist/users/user-facts.d.ts +10 -0
  516. package/dist/users/user-facts.js +157 -0
  517. package/dist/users/user-facts.js.map +1 -0
  518. package/dist/users/user-segments.d.ts +10 -0
  519. package/dist/users/user-segments.js +32 -0
  520. package/dist/users/user-segments.js.map +1 -0
  521. package/dist/utils/billing-displays.d.ts +6 -0
  522. package/dist/utils/billing-displays.js +17 -0
  523. package/dist/utils/billing-displays.js.map +1 -0
  524. package/dist/utils/billing-document-status.d.ts +0 -4
  525. package/dist/utils/billing-document-status.js +1 -13
  526. package/dist/utils/billing-document-status.js.map +1 -1
  527. package/dist/utils/billing-document-type.d.ts +6 -0
  528. package/dist/utils/billing-document-type.js +13 -0
  529. package/dist/utils/billing-document-type.js.map +1 -1
  530. package/dist/utils/content-language.d.ts +2 -0
  531. package/dist/utils/content-language.js +12 -0
  532. package/dist/utils/content-language.js.map +1 -0
  533. package/dist/utils/csv-file.d.ts +2 -0
  534. package/dist/utils/csv-file.js +23 -0
  535. package/dist/utils/csv-file.js.map +1 -0
  536. package/dist/utils/form-insight-type.d.ts +8 -0
  537. package/dist/utils/form-insight-type.js +34 -0
  538. package/dist/utils/form-insight-type.js.map +1 -0
  539. package/dist/utils/index.d.ts +9 -0
  540. package/dist/utils/index.js +9 -0
  541. package/dist/utils/index.js.map +1 -1
  542. package/dist/utils/language.d.ts +1 -0
  543. package/dist/utils/language.js +7 -0
  544. package/dist/utils/language.js.map +1 -0
  545. package/dist/utils/money.d.ts +2 -0
  546. package/dist/utils/money.js +24 -0
  547. package/dist/utils/money.js.map +1 -0
  548. package/dist/utils/segment-evaluator.d.ts +4 -0
  549. package/dist/utils/segment-evaluator.js +15 -8
  550. package/dist/utils/segment-evaluator.js.map +1 -1
  551. package/dist/utils/segment-explain.d.ts +10 -0
  552. package/dist/utils/segment-explain.js +31 -0
  553. package/dist/utils/segment-explain.js.map +1 -0
  554. package/dist/utils/segment-fields.d.ts +13 -2
  555. package/dist/utils/segment-fields.js +137 -116
  556. package/dist/utils/segment-fields.js.map +1 -1
  557. package/dist/utils/segment-matching.d.ts +14 -3
  558. package/dist/utils/segment-matching.js +47 -13
  559. package/dist/utils/segment-matching.js.map +1 -1
  560. package/dist/utils/segment-preview.d.ts +31 -0
  561. package/dist/utils/segment-preview.js +83 -0
  562. package/dist/utils/segment-preview.js.map +1 -0
  563. package/dist/utils/segment-user-projection.d.ts +3 -0
  564. package/dist/utils/segment-user-projection.js +31 -0
  565. package/dist/utils/segment-user-projection.js.map +1 -0
  566. package/dist/utils/segment-validation.d.ts +14 -0
  567. package/dist/utils/segment-validation.js +98 -0
  568. package/dist/utils/segment-validation.js.map +1 -0
  569. package/dist/utils/status-vocabulary.d.ts +57 -0
  570. package/dist/utils/status-vocabulary.js +92 -0
  571. package/dist/utils/status-vocabulary.js.map +1 -0
  572. package/dist/workers/index.d.ts +1 -0
  573. package/dist/workers/index.js +1 -0
  574. package/dist/workers/index.js.map +1 -1
  575. package/dist/workers/plan-migration-resolution.d.ts +14 -0
  576. package/dist/workers/plan-migration-resolution.js +99 -0
  577. package/dist/workers/plan-migration-resolution.js.map +1 -0
  578. package/dist/workers/plan-migration.d.ts +6 -1
  579. package/dist/workers/plan-migration.js +152 -37
  580. package/dist/workers/plan-migration.js.map +1 -1
  581. package/dist/workspaces/billing-identity-lock.d.ts +1 -0
  582. package/dist/workspaces/billing-identity-lock.js +18 -0
  583. package/dist/workspaces/billing-identity-lock.js.map +1 -0
  584. package/dist/workspaces/complimentary-banner.d.ts +11 -0
  585. package/dist/workspaces/complimentary-banner.js +83 -0
  586. package/dist/workspaces/complimentary-banner.js.map +1 -0
  587. package/dist/workspaces/default-member-role.d.ts +2 -0
  588. package/dist/workspaces/default-member-role.js +43 -0
  589. package/dist/workspaces/default-member-role.js.map +1 -0
  590. package/dist/workspaces/deletion-request.d.ts +2 -0
  591. package/dist/workspaces/deletion-request.js +5 -0
  592. package/dist/workspaces/deletion-request.js.map +1 -0
  593. package/dist/workspaces/deletion.d.ts +1 -1
  594. package/dist/workspaces/deletion.js +19 -7
  595. package/dist/workspaces/deletion.js.map +1 -1
  596. package/dist/workspaces/detail-items.d.ts +15 -0
  597. package/dist/workspaces/detail-items.js +226 -0
  598. package/dist/workspaces/detail-items.js.map +1 -0
  599. package/dist/workspaces/first-payment.d.ts +5 -0
  600. package/dist/workspaces/first-payment.js +28 -0
  601. package/dist/workspaces/first-payment.js.map +1 -0
  602. package/dist/workspaces/free-workspaces-per-card.d.ts +6 -0
  603. package/dist/workspaces/free-workspaces-per-card.js +58 -0
  604. package/dist/workspaces/free-workspaces-per-card.js.map +1 -0
  605. package/dist/workspaces/index.d.ts +7 -0
  606. package/dist/workspaces/index.js +7 -0
  607. package/dist/workspaces/index.js.map +1 -1
  608. package/dist/workspaces/invitations.d.ts +2 -1
  609. package/dist/workspaces/invitations.js +16 -6
  610. package/dist/workspaces/invitations.js.map +1 -1
  611. package/dist/workspaces/my-workspaces.d.ts +13 -0
  612. package/dist/workspaces/my-workspaces.js +68 -0
  613. package/dist/workspaces/my-workspaces.js.map +1 -0
  614. package/dist/workspaces/operator-creation.d.ts +39 -0
  615. package/dist/workspaces/operator-creation.js +123 -0
  616. package/dist/workspaces/operator-creation.js.map +1 -0
  617. package/dist/workspaces/operator-view.d.ts +13 -0
  618. package/dist/workspaces/operator-view.js +37 -0
  619. package/dist/workspaces/operator-view.js.map +1 -0
  620. package/dist/workspaces/owner-contact.d.ts +7 -0
  621. package/dist/workspaces/owner-contact.js +24 -0
  622. package/dist/workspaces/owner-contact.js.map +1 -0
  623. package/dist/workspaces/owner-invitation-email.d.ts +12 -0
  624. package/dist/workspaces/owner-invitation-email.js +53 -0
  625. package/dist/workspaces/owner-invitation-email.js.map +1 -0
  626. package/dist/workspaces/provisioning.d.ts +2 -0
  627. package/dist/workspaces/provisioning.js +37 -15
  628. package/dist/workspaces/provisioning.js.map +1 -1
  629. package/dist/workspaces/self-serve-creation.d.ts +38 -0
  630. package/dist/workspaces/self-serve-creation.js +106 -0
  631. package/dist/workspaces/self-serve-creation.js.map +1 -0
  632. package/dist/workspaces/workspace-glance.d.ts +3 -0
  633. package/dist/workspaces/workspace-glance.js +93 -0
  634. package/dist/workspaces/workspace-glance.js.map +1 -0
  635. package/dist/workspaces/workspace-name.d.ts +2 -0
  636. package/dist/workspaces/workspace-name.js +14 -0
  637. package/dist/workspaces/workspace-name.js.map +1 -0
  638. package/dist/workspaces/workspace-overview.d.ts +41 -0
  639. package/dist/workspaces/workspace-overview.js +84 -0
  640. package/dist/workspaces/workspace-overview.js.map +1 -0
  641. package/dist/workspaces/workspace-owner.d.ts +7 -0
  642. package/dist/workspaces/workspace-owner.js +14 -0
  643. package/dist/workspaces/workspace-owner.js.map +1 -0
  644. package/frontend-vue/app/build/PayInvoiceDialog.vue +40 -0
  645. package/frontend-vue/app/build/PayInvoicePanel.vue +203 -0
  646. package/frontend-vue/app/build/PlanChangeReview.vue +415 -0
  647. package/frontend-vue/app/build/PlanFeatureValueInput.vue +143 -0
  648. package/frontend-vue/app/build/PlanPermissionPicker.vue +246 -0
  649. package/frontend-vue/app/build/WorkspaceSwitcherRow.vue +116 -0
  650. package/frontend-vue/app/build/components/CreditNoteInvoiceSummary.vue +82 -0
  651. package/frontend-vue/app/build/components/FormFieldRow.vue +97 -0
  652. package/frontend-vue/app/build/components/FormRows.vue +26 -0
  653. package/frontend-vue/app/build/components/RequiredLegend.vue +7 -0
  654. package/frontend-vue/app/build/composables/useCreditNoteDraft.ts +142 -0
  655. package/frontend-vue/app/build/composables/useCreditNoteTexts.ts +123 -0
  656. package/frontend-vue/app/build/composables/useLiveFormValues.ts +49 -0
  657. package/frontend-vue/app/build/day-formats.ts +17 -0
  658. package/frontend-vue/app/build/highlight.ts +28 -0
  659. package/frontend-vue/app/build/plan-catalog.ts +161 -0
  660. package/frontend-vue/app/build/plan-change-heading.ts +81 -0
  661. package/frontend-vue/app/build/plan-permissions.ts +92 -0
  662. package/frontend-vue/app/build/plan-retire.ts +83 -0
  663. package/frontend-vue/app/build/public/AccessTimeline.vue +68 -0
  664. package/frontend-vue/app/build/public/LegalAcceptance.vue +51 -0
  665. package/frontend-vue/app/build/public/OtherWorkspaces.vue +88 -0
  666. package/frontend-vue/app/build/public/PricingComparison.vue +227 -0
  667. package/frontend-vue/app/build/public/PricingFaq.vue +76 -0
  668. package/frontend-vue/app/build/public/PublicStage.vue +72 -0
  669. package/frontend-vue/app/build/public/RegistrationCardField.vue +71 -0
  670. package/frontend-vue/app/build/public/RegistrationPlanCard.vue +122 -0
  671. package/frontend-vue/app/build/public/access.ts +118 -0
  672. package/frontend-vue/app/build/public/chosen-plan.ts +36 -0
  673. package/frontend-vue/app/build/public/legal.ts +99 -0
  674. package/frontend-vue/app/build/public/pricing.ts +175 -0
  675. package/frontend-vue/app/build/public/routes.ts +122 -0
  676. package/frontend-vue/app/build/public/usePublicFetch.ts +44 -0
  677. package/frontend-vue/app/build/public/usePublicPlanFormat.ts +52 -0
  678. package/frontend-vue/app/build/segments/tree.ts +137 -0
  679. package/frontend-vue/app/build/segments/types.ts +119 -0
  680. package/frontend-vue/app/build/segments/useSegmentCatalog.ts +58 -0
  681. package/frontend-vue/app/build/segments/useSegmentDraft.ts +33 -0
  682. package/frontend-vue/app/build/segments/useSegmentPreview.ts +78 -0
  683. package/frontend-vue/app/build/segments/useSegmentSentence.ts +60 -0
  684. package/frontend-vue/app/build/segments/useSegmentWords.ts +204 -0
  685. package/frontend-vue/app/build/useWorkspaceName.ts +14 -0
  686. package/frontend-vue/app/build/users/useUserDetail.ts +82 -0
  687. package/frontend-vue/app/build/workspace-detail/ComplimentaryDialog.vue +219 -0
  688. package/frontend-vue/app/build/workspace-detail/CreditDialog.vue +243 -0
  689. package/frontend-vue/app/build/workspace-detail/UpgradeDialog.vue +258 -0
  690. package/frontend-vue/app/build/workspace-detail/WorkspaceActionDialogs.vue +82 -0
  691. package/frontend-vue/app/build/workspace-detail/planPrice.ts +26 -0
  692. package/frontend-vue/app/build/workspace-detail/types.ts +138 -0
  693. package/frontend-vue/app/build/workspace-detail/useWorkspaceActions.ts +177 -0
  694. package/frontend-vue/app/build/workspace-detail/useWorkspaceOverview.ts +44 -0
  695. package/frontend-vue/app/build/workspace-paths.ts +8 -0
  696. package/frontend-vue/app/components/BillingIdentityFields.vue +294 -161
  697. package/frontend-vue/app/components/CustomerPortalButton.vue +80 -32
  698. package/frontend-vue/app/components/DataExport.vue +250 -260
  699. package/frontend-vue/app/components/DataExportHistory.vue +246 -0
  700. package/frontend-vue/app/components/DunningTimeline.vue +120 -0
  701. package/frontend-vue/app/components/IssueCreditNoteModal.vue +318 -116
  702. package/frontend-vue/app/components/LegalDocumentRelease.vue +64 -0
  703. package/frontend-vue/app/components/LegalLayout.vue +284 -46
  704. package/frontend-vue/app/components/MigrationStripeCheck.vue +133 -0
  705. package/frontend-vue/app/components/PastDueAlert.vue +186 -78
  706. package/frontend-vue/app/components/PastDueBanner.vue +96 -67
  707. package/frontend-vue/app/components/PayInvoiceModal.vue +57 -0
  708. package/frontend-vue/app/components/PaymentMethodCard.vue +159 -163
  709. package/frontend-vue/app/components/PendingCheckoutModal.vue +61 -61
  710. package/frontend-vue/app/components/PlanAccessEditor.vue +410 -0
  711. package/frontend-vue/app/components/PlanCard.vue +358 -261
  712. package/frontend-vue/app/components/PlanCardPublic.vue +123 -51
  713. package/frontend-vue/app/components/PlanComparisonModal.vue +373 -310
  714. package/frontend-vue/app/components/PlanEditorPreview.vue +374 -0
  715. package/frontend-vue/app/components/PlanLimitInput.vue +92 -0
  716. package/frontend-vue/app/components/PlanTaxSync.vue +118 -0
  717. package/frontend-vue/app/components/PlanUpgradeModal.vue +265 -156
  718. package/frontend-vue/app/components/PlatformNotes.vue +215 -255
  719. package/frontend-vue/app/components/Pricing.vue +236 -0
  720. package/frontend-vue/app/components/PublicNavBar.vue +70 -0
  721. package/frontend-vue/app/components/RefundButton.vue +264 -113
  722. package/frontend-vue/app/components/RefundExample.vue +86 -0
  723. package/frontend-vue/app/components/Register.vue +217 -121
  724. package/frontend-vue/app/components/RegistrationClosed.vue +30 -13
  725. package/frontend-vue/app/components/RetirePlanModal.vue +829 -0
  726. package/frontend-vue/app/components/SeatQuotaBanner.vue +240 -90
  727. package/frontend-vue/app/components/SegmentConditionRow.vue +171 -0
  728. package/frontend-vue/app/components/SegmentConditionsBuilder.vue +89 -162
  729. package/frontend-vue/app/components/SegmentConditionsGroup.vue +273 -463
  730. package/frontend-vue/app/components/SegmentLivePreview.vue +301 -0
  731. package/frontend-vue/app/components/SegmentLogicToggle.vue +24 -0
  732. package/frontend-vue/app/components/SegmentRulesText.vue +57 -0
  733. package/frontend-vue/app/components/SegmentValueInput.vue +165 -0
  734. package/frontend-vue/app/components/SegmentWords.vue +36 -0
  735. package/frontend-vue/app/components/TenantBillingForm.vue +142 -103
  736. package/frontend-vue/app/components/TenantPlanCard.vue +635 -281
  737. package/frontend-vue/app/components/TrialEndingBanner.vue +76 -0
  738. package/frontend-vue/app/components/UserPlatformRoleCard.vue +102 -0
  739. package/frontend-vue/app/components/UserSegmentMatches.vue +123 -0
  740. package/frontend-vue/app/components/UserSummaryCard.vue +107 -158
  741. package/frontend-vue/app/components/WorkspaceAdminCreateModal.vue +354 -177
  742. package/frontend-vue/app/components/WorkspaceCreateModal.vue +372 -252
  743. package/frontend-vue/app/components/WorkspaceDangerZone.vue +178 -126
  744. package/frontend-vue/app/components/WorkspaceDetailHeader.vue +262 -19
  745. package/frontend-vue/app/components/WorkspaceInvitationLink.vue +108 -86
  746. package/frontend-vue/app/components/WorkspaceOperatorActions.vue +105 -330
  747. package/frontend-vue/app/components/WorkspaceSuspendButton.vue +34 -158
  748. package/frontend-vue/app/components/WorkspaceSuspended.vue +390 -149
  749. package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +145 -161
  750. package/frontend-vue/app/composables/useBillingIdentity.ts +97 -95
  751. package/frontend-vue/app/composables/useBillingStatus.ts +56 -24
  752. package/frontend-vue/app/composables/useCurrentWorkspace.ts +15 -30
  753. package/frontend-vue/app/composables/useDaysLeft.ts +20 -0
  754. package/frontend-vue/app/composables/useExportHistory.ts +209 -120
  755. package/frontend-vue/app/composables/useInvitationLink.ts +39 -53
  756. package/frontend-vue/app/composables/useMoneyFormat.ts +64 -33
  757. package/frontend-vue/app/composables/useMyWorkspaces.ts +41 -32
  758. package/frontend-vue/app/composables/useNextInvoice.ts +20 -0
  759. package/frontend-vue/app/composables/usePayInvoice.ts +52 -0
  760. package/frontend-vue/app/composables/usePendingCheckout.ts +71 -67
  761. package/frontend-vue/app/composables/usePlanCatalog.ts +16 -0
  762. package/frontend-vue/app/composables/usePlanChangeReview.ts +115 -0
  763. package/frontend-vue/app/composables/usePlanComparison.ts +17 -8
  764. package/frontend-vue/app/composables/usePlanDowngrade.ts +25 -23
  765. package/frontend-vue/app/composables/usePlanFeatureFormat.ts +238 -202
  766. package/frontend-vue/app/composables/usePlanPriceLabel.ts +28 -0
  767. package/frontend-vue/app/composables/useSaasRegistration.ts +516 -301
  768. package/frontend-vue/app/composables/useSaasStatus.ts +81 -0
  769. package/frontend-vue/app/composables/useSeatQuota.ts +27 -17
  770. package/frontend-vue/app/composables/useServerConfirm.ts +44 -0
  771. package/frontend-vue/app/composables/useStripePaymentElement.ts +3 -5
  772. package/frontend-vue/app/composables/useTenantPlan.ts +235 -99
  773. package/frontend-vue/app/composables/useUpgradeAuthentication.ts +37 -0
  774. package/frontend-vue/app/composables/useWorkspaceFinalization.ts +4 -0
  775. package/frontend-vue/app/composables/useWorkspaceOverview.ts +58 -0
  776. package/frontend-vue/app/composables/useWorkspaceRenamed.ts +33 -0
  777. package/frontend-vue/app/custom-pages/auth/no-workspace.vue +391 -312
  778. package/frontend-vue/app/plugins/auth-links.ts +38 -17
  779. package/frontend-vue/app/plugins/billing-data-types.ts +111 -58
  780. package/frontend-vue/app/plugins/footer-links.ts +13 -33
  781. package/frontend-vue/app/plugins/segment-conditions-data-type.ts +45 -0
  782. package/frontend-vue/app/plugins/sidebar-widgets.ts +13 -10
  783. package/frontend-vue/app/types/runtime-config.ts +9 -4
  784. package/frontend-vue/dms.frontend.build.ts +7 -0
  785. package/frontend-vue/dms.frontend.ts +6 -13
  786. package/frontend-vue/i18n/locales/saas-en-GB.json +499 -1380
  787. package/frontend-vue/i18n/locales/saas-fr-FR.json +499 -1380
  788. package/frontend-vue/i18n/locales/saas-operator-billing-en-GB.json +282 -0
  789. package/frontend-vue/i18n/locales/saas-operator-billing-fr-FR.json +282 -0
  790. package/frontend-vue/i18n/locales/saas-operator-catalog-en-GB.json +597 -0
  791. package/frontend-vue/i18n/locales/saas-operator-catalog-fr-FR.json +597 -0
  792. package/frontend-vue/i18n/locales/saas-operator-users-en-GB.json +505 -0
  793. package/frontend-vue/i18n/locales/saas-operator-users-fr-FR.json +505 -0
  794. package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +595 -0
  795. package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +595 -0
  796. package/frontend-vue/i18n/locales/saas-public-en-GB.json +304 -0
  797. package/frontend-vue/i18n/locales/saas-public-fr-FR.json +304 -0
  798. package/frontend-vue/i18n/locales/saas-tenant-billing-en-GB.json +434 -0
  799. package/frontend-vue/i18n/locales/saas-tenant-billing-fr-FR.json +434 -0
  800. package/frontend-vue/i18n/locales/saas-tenant-workspace-en-GB.json +252 -0
  801. package/frontend-vue/i18n/locales/saas-tenant-workspace-fr-FR.json +252 -0
  802. package/frontend-vue/package.json +1 -1
  803. package/package.json +10 -10
  804. package/frontend-vue/app/components/CardGrid.vue +0 -77
  805. package/frontend-vue/app/components/DeletePlanModal.vue +0 -223
  806. package/frontend-vue/app/components/FreeAccessBanner.vue +0 -70
  807. package/frontend-vue/app/components/PlanCardsDisplay.vue +0 -127
  808. package/frontend-vue/app/components/PlanInheritancePicker.vue +0 -329
  809. package/frontend-vue/app/components/RecentActivity.vue +0 -72
  810. package/frontend-vue/app/components/WorkspaceBillingInfo.vue +0 -68
  811. package/frontend-vue/app/components/WorkspaceCompAccessButton.vue +0 -198
  812. package/frontend-vue/app/components/WorkspaceIdentity.vue +0 -99
  813. package/frontend-vue/app/components/WorkspaceJoinButton.vue +0 -50
  814. package/frontend-vue/app/components/WorkspaceSummaryCard.vue +0 -185
  815. package/frontend-vue/app/composables/useDetailRefresh.ts +0 -17
  816. package/frontend-vue/app/composables/usePastDueBannerAction.ts +0 -20
  817. package/frontend-vue/app/composables/usePlanFeatureLabel.ts +0 -24
  818. package/frontend-vue/app/plugins/plan-cards-display.client.ts +0 -16
  819. package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +0 -122
@@ -1,13 +1,18 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, onMounted, ref, watch } from 'vue'
3
+ import { HOME_PATH } from '../build/workspace-paths'
4
+ import WorkspaceSwitcherRow from '../build/WorkspaceSwitcherRow.vue'
3
5
 
4
6
  const props = defineProps<{
5
7
  collapsed?: boolean
6
8
  }>()
7
9
 
10
+ const KEYS = 'saas.workspace.switcher'
11
+ const SEARCH_THRESHOLD = 6
12
+ const PAST_DUE_STATUS = 'past_due'
8
13
  const toast = useToast()
9
14
  const { t } = useI18n()
10
- const { resolveApiError } = useApiErrorMessage()
15
+ const { statusView } = useSaasStatus()
11
16
 
12
17
  // Platform owners are not tenant members by default, so an owner can legitimately
13
18
  // have no workspace at all — the switcher must still offer them a way in.
@@ -20,40 +25,43 @@ const canCreateWorkspace = computed(
20
25
  ?.admissionMode !== 'invitation-only',
21
26
  )
22
27
 
23
- const SEARCH_THRESHOLD = 6
24
- const HOME_ROUTE = '/'
25
-
26
- const { workspaces, refresh } = useMyWorkspaces()
27
- const isLoading = ref(true)
28
+ const { workspaces, isLoaded, refresh } = useMyWorkspaces()
29
+ const hasFailed = ref(false)
28
30
  const isOpen = ref(false)
29
31
  const isCreateOpen = ref(false)
30
32
  const searchQuery = ref('')
31
33
  const switchingId = ref<string | null>(null)
32
34
 
33
- const current = computed<MyWorkspace | undefined>(
34
- () => workspaces.value.find((w) => w.isCurrent) ?? workspaces.value[0],
35
+ const current = computed<MyWorkspace | undefined>(() =>
36
+ workspaces.value.find((workspace) => workspace.isCurrent),
35
37
  )
36
-
38
+ const isPastDue = computed(() => current.value?.status === PAST_DUE_STATUS)
37
39
  const showSearch = computed(() => workspaces.value.length >= SEARCH_THRESHOLD)
38
-
39
- const isVisible = computed(() => !!current.value || isOwner.value)
40
-
41
- const triggerLabel = computed(
42
- () => current.value?.name ?? t('saas.workspaces.none'),
40
+ const isVisible = computed(
41
+ () => workspaces.value.length > 0 || isOwner.value || hasFailed.value,
43
42
  )
44
43
 
44
+ const triggerLabel = computed(() => current.value?.name ?? t(`${KEYS}.none`))
45
45
  const triggerCaption = computed(
46
- () => current.value?.planName ?? t('saas.workspaces.current_label'),
46
+ () => current.value?.planName ?? t(`${KEYS}.caption`),
47
47
  )
48
48
 
49
+ const tooltip = computed(() => {
50
+ const workspace = current.value
51
+ if (!workspace) return triggerLabel.value
52
+ const parts = [workspace.name, workspace.planName ?? t(`${KEYS}.no_plan`)]
53
+ if (isPastDue.value) parts.push(t(`${KEYS}.payment_failed`))
54
+ return parts.join(' · ')
55
+ })
56
+
49
57
  const filtered = computed<MyWorkspace[]>(() => {
50
58
  const needle = searchQuery.value.trim().toLowerCase()
51
59
  if (!needle) return workspaces.value
52
- return workspaces.value.filter((w) => w.name.toLowerCase().includes(needle))
53
- })
54
-
55
- watch(isOpen, (open) => {
56
- if (!open) searchQuery.value = ''
60
+ return workspaces.value.filter((workspace) =>
61
+ [workspace.name, workspace.ownerName ?? ''].some((text) =>
62
+ text.toLowerCase().includes(needle),
63
+ ),
64
+ )
57
65
  })
58
66
 
59
67
  const popoverPlacement = computed(() =>
@@ -62,6 +70,10 @@ const popoverPlacement = computed(() =>
62
70
  : { side: 'bottom' as const, align: 'start' as const, sideOffset: 6 },
63
71
  )
64
72
 
73
+ watch(isOpen, (open) => {
74
+ if (!open && !switchingId.value) searchQuery.value = ''
75
+ })
76
+
65
77
  function initialOf(name: string): string {
66
78
  return (name.trim()[0] ?? '?').toUpperCase()
67
79
  }
@@ -69,27 +81,33 @@ function initialOf(name: string): string {
69
81
  async function load(): Promise<void> {
70
82
  try {
71
83
  await refresh()
84
+ hasFailed.value = false
72
85
  } catch {
73
- // Errors are swallowed on purpose: useMyWorkspaces already decides what the
74
- // list becomes, and the sidebar is no place for an error card.
75
- } finally {
76
- isLoading.value = false
86
+ hasFailed.value = true
77
87
  }
78
88
  }
79
89
 
90
+ function reportSwitchFailure(target: MyWorkspace | string): void {
91
+ const name = typeof target === 'string' ? target : target.name
92
+ toast.add({
93
+ title: t(`${KEYS}.switch_failed`, { name }),
94
+ description: current.value
95
+ ? t(`${KEYS}.still_in`, { name: current.value.name })
96
+ : undefined,
97
+ color: 'error',
98
+ icon: 'i-ph-warning-circle',
99
+ })
100
+ }
101
+
102
+ /** The popover stays open until the page reloads into the new workspace. */
80
103
  async function selectWorkspace(workspace: MyWorkspace): Promise<void> {
81
104
  if (workspace.isCurrent || switchingId.value) return
82
105
  switchingId.value = workspace._id
83
106
  try {
84
- // Reloads the page on success, so the switching state never resets.
85
107
  await useTenantSwitch(workspace._id)
86
- } catch (error) {
108
+ } catch {
87
109
  switchingId.value = null
88
- toast.add({
89
- title: resolveApiError(error, 'saas.workspaces.switch_error'),
90
- color: 'error',
91
- icon: 'i-ph-warning-circle',
92
- })
110
+ reportSwitchFailure(workspace)
93
111
  }
94
112
  }
95
113
 
@@ -102,28 +120,31 @@ function closeCreateModal(): void {
102
120
  isCreateOpen.value = false
103
121
  }
104
122
 
105
- async function onWorkspaceCreated(tenantId: string): Promise<void> {
123
+ async function onWorkspaceCreated(
124
+ tenantId: string,
125
+ name: string,
126
+ ): Promise<void> {
106
127
  isCreateOpen.value = false
107
128
  try {
108
- // Lands on the DMS homepage rather than reloading the settings screen the
109
- // creation was started from — that screen belongs to the previous tenant.
110
- await useTenantSwitch(tenantId, HOME_ROUTE)
111
- } catch (error) {
112
- toast.add({
113
- title: resolveApiError(error, 'saas.workspaces.switch_error'),
114
- color: 'error',
115
- icon: 'i-ph-warning-circle',
116
- })
117
- load()
129
+ // Lands on the homepage rather than reloading the screen the creation
130
+ // was started from — that screen belongs to the previous workspace.
131
+ await useTenantSwitch(tenantId, HOME_PATH)
132
+ } catch {
133
+ reportSwitchFailure(name)
134
+ await load()
118
135
  }
119
136
  }
120
137
 
121
- onMounted(load)
138
+ useWorkspaceRenamed(() => void load())
139
+
140
+ onMounted(() => {
141
+ if (!isLoaded.value) void load()
142
+ })
122
143
  </script>
123
144
 
124
145
  <template>
125
146
  <USkeleton
126
- v-if="isLoading"
147
+ v-if="!isLoaded && !hasFailed"
127
148
  :class="
128
149
  collapsed ? 'mx-auto size-9 rounded-md' : 'h-[46px] w-full rounded-md'
129
150
  "
@@ -132,42 +153,31 @@ onMounted(load)
132
153
  v-else-if="isVisible"
133
154
  v-model:open="isOpen"
134
155
  :content="popoverPlacement"
135
- :ui="{
136
- content: 'rounded-none border-0 bg-transparent p-0 shadow-none ring-0',
137
- }"
138
156
  >
139
157
  <UTooltip
140
- :text="triggerLabel"
158
+ :text="tooltip"
141
159
  :disabled="!collapsed"
142
160
  :content="{ side: 'right' }"
143
161
  >
144
162
  <button
145
163
  type="button"
146
- class="border-default bg-elevated text-highlighted hover:border-accented flex items-center gap-2.5 rounded-md border text-left transition-colors duration-150"
164
+ class="border-default bg-elevated text-highlighted hover:border-accented relative flex items-center gap-2.5 rounded-md border text-left transition-colors duration-150"
147
165
  :class="
148
166
  collapsed ? 'size-9 justify-center p-1' : 'w-full px-2.5 py-[9px]'
149
167
  "
150
- :aria-label="$t('saas.workspaces.switcher_title')"
168
+ :aria-label="$t(`${KEYS}.title`)"
151
169
  >
152
170
  <span
153
- class="from-primary-500 to-primary-600 bg-linear-to-br inline-flex size-[26px] shrink-0 items-center justify-center rounded-md text-[13px] font-bold text-white"
171
+ class="from-primary-500 to-primary-600 bg-linear-to-br relative inline-flex size-[26px] shrink-0 items-center justify-center rounded-md text-[13px] font-bold text-white"
154
172
  >
155
173
  <template v-if="current">{{ initialOf(current.name) }}</template>
156
- <svg
157
- v-if="!current"
158
- class="size-4"
159
- viewBox="0 0 24 24"
160
- fill="none"
161
- stroke="currentColor"
162
- stroke-width="1.8"
163
- stroke-linecap="round"
164
- stroke-linejoin="round"
165
- aria-hidden="true"
166
- >
167
- <path
168
- d="M3 21h18M5 21V5l7-3 7 3v16M9 9h.01M15 9h.01M9 13h.01M15 13h.01M9 17h.01M15 17h.01"
169
- />
170
- </svg>
174
+ <UIcon v-else name="i-ph-buildings" class="size-4" />
175
+ <span
176
+ v-if="isPastDue"
177
+ class="bg-error ring-default absolute -right-1 -top-1 size-2.5 rounded-full ring-2"
178
+ :aria-label="$t(`${KEYS}.payment_failed`)"
179
+ role="img"
180
+ />
171
181
  </span>
172
182
  <template v-if="!collapsed">
173
183
  <span class="flex min-w-0 flex-1 flex-col leading-[1.25]">
@@ -177,127 +187,101 @@ onMounted(load)
177
187
  {{ triggerCaption }}
178
188
  </span>
179
189
  <span
180
- class="text-highlighted overflow-hidden text-ellipsis whitespace-nowrap text-[13.5px] font-semibold tracking-[-0.01em]"
190
+ class="text-highlighted truncate text-[13.5px] font-semibold tracking-[-0.01em]"
181
191
  >
182
192
  {{ triggerLabel }}
183
193
  </span>
184
194
  </span>
185
- <span
186
- class="text-dimmed ml-auto inline-flex size-4 shrink-0"
187
- aria-hidden="true"
188
- >
189
- <svg
190
- class="h-full w-full"
191
- viewBox="0 0 24 24"
192
- fill="none"
193
- stroke="currentColor"
194
- stroke-width="1.8"
195
- stroke-linecap="round"
196
- stroke-linejoin="round"
197
- >
198
- <path d="m7 15 5 5 5-5" />
199
- <path d="m7 9 5-5 5 5" />
200
- </svg>
201
- </span>
195
+ <UIcon
196
+ name="i-ph-caret-up-down"
197
+ class="text-dimmed ml-auto size-4 shrink-0"
198
+ />
202
199
  </template>
203
200
  </button>
204
201
  </UTooltip>
205
202
 
206
203
  <template #content>
207
- <div
208
- class="border-accented bg-elevated flex w-56 flex-col gap-0.5 rounded-lg border p-[5px] shadow-lg"
209
- >
210
- <p class="text-dimmed m-0 px-[9px] pb-[3px] pt-[5px] text-[10.5px]">
211
- {{ $t('saas.workspaces.switcher_title') }}
204
+ <div class="flex w-72 flex-col gap-1 p-1.5">
205
+ <p
206
+ class="text-dimmed flex items-center gap-1.5 px-2 pb-0.5 pt-1 text-[11px]"
207
+ >
208
+ {{ $t(`${KEYS}.title`) }}
209
+ <UBadge
210
+ v-if="showSearch"
211
+ :label="String(workspaces.length)"
212
+ color="neutral"
213
+ variant="soft"
214
+ size="sm"
215
+ class="font-mono"
216
+ />
212
217
  </p>
213
- <input
218
+ <UInput
214
219
  v-if="showSearch"
215
220
  v-model="searchQuery"
216
- class="border-accented bg-default text-highlighted w-full rounded-md border px-2 py-1.5 text-xs"
217
- type="search"
218
- :placeholder="$t('saas.workspaces.select')"
221
+ size="sm"
222
+ icon="i-ph-magnifying-glass"
223
+ :placeholder="$t(`${KEYS}.search`)"
224
+ :aria-label="$t(`${KEYS}.search`)"
225
+ autofocus
226
+ />
227
+ <DmsSaasLoadFailure
228
+ v-if="hasFailed && !workspaces.length"
229
+ :title="$t(`${KEYS}.load_failed`)"
230
+ @retry="load"
219
231
  />
220
232
  <ul
221
- v-if="filtered.length"
222
- class="m-0 max-h-64 list-none overflow-y-auto p-0"
233
+ v-else-if="filtered.length"
234
+ class="m-0 flex max-h-72 list-none flex-col gap-0.5 overflow-y-auto p-0"
223
235
  >
224
236
  <li v-for="workspace in filtered" :key="workspace._id">
225
- <button
226
- type="button"
227
- class="hover:bg-accented hover:text-highlighted flex w-full items-center gap-[9px] rounded-md border-0 px-[9px] py-2 text-left text-[13px]"
228
- :class="[
229
- workspace.isCurrent
230
- ? 'bg-primary/12 text-highlighted'
231
- : 'text-muted bg-transparent',
232
- { 'cursor-default': workspace.isCurrent || !!switchingId },
233
- ]"
234
- @click="selectWorkspace(workspace)"
235
- >
236
- <span
237
- class="from-primary-500 to-primary-600 bg-linear-to-br inline-flex size-[22px] shrink-0 items-center justify-center rounded-[5px] text-[11px] font-bold text-white"
238
- >
239
- {{ initialOf(workspace.name) }}
240
- </span>
241
- <span
242
- class="min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap"
243
- :class="{ 'text-highlighted': workspace.isCurrent }"
244
- >
245
- {{ workspace.name }}
246
- </span>
247
- <span
248
- v-if="workspace.planName"
249
- class="text-primary shrink-0 whitespace-nowrap font-mono text-[9.5px] uppercase tracking-[0.08em]"
250
- >
251
- {{ workspace.planName }}
252
- </span>
253
- <span
254
- v-if="switchingId === workspace._id"
255
- class="border-(--ui-text-dimmed) border-t-primary size-3.5 shrink-0 animate-spin rounded-full border-2 [animation-duration:700ms]"
256
- aria-hidden="true"
257
- />
258
- <span
259
- v-else-if="workspace.isCurrent"
260
- class="text-primary inline-flex size-4 shrink-0"
261
- aria-hidden="true"
262
- >
263
- <svg
264
- class="h-full w-full"
265
- viewBox="0 0 24 24"
266
- fill="none"
267
- stroke="currentColor"
268
- stroke-width="1.8"
269
- stroke-linecap="round"
270
- stroke-linejoin="round"
271
- >
272
- <path d="m4 12 5 5L20 6" />
273
- </svg>
274
- </span>
275
- </button>
237
+ <WorkspaceSwitcherRow
238
+ :workspace="workspace"
239
+ :query="searchQuery"
240
+ :is-switching="switchingId === workspace._id"
241
+ :is-disabled="!!switchingId"
242
+ @select="selectWorkspace"
243
+ />
276
244
  </li>
277
245
  </ul>
278
- <p
246
+ <div
279
247
  v-else-if="workspaces.length"
280
- class="text-dimmed m-0 px-[9px] py-2 text-[13px]"
248
+ class="flex flex-col items-start gap-1 px-2 py-2"
281
249
  >
282
- {{ $t('saas.workspaces.no_results') }}
283
- </p>
284
- <div v-if="workspaces.length" class="bg-border mx-0.5 my-1 h-px" />
285
- <button
286
- v-if="canCreateWorkspace"
287
- type="button"
288
- class="text-primary w-full justify-start border-0 bg-transparent px-[9px] py-2 text-left text-[13px]"
289
- @click="openCreateModal"
290
- >
291
- + {{ $t('saas.workspaces.create.button') }}
292
- </button>
250
+ <p class="text-muted text-[13px]">
251
+ {{ $t(`${KEYS}.no_match`, { query: searchQuery.trim() }) }}
252
+ </p>
253
+ <UButton
254
+ color="neutral"
255
+ variant="link"
256
+ size="xs"
257
+ class="px-0"
258
+ @click="searchQuery = ''"
259
+ >
260
+ {{ $t(`${KEYS}.clear_search`) }}
261
+ </UButton>
262
+ </div>
263
+ <template v-if="canCreateWorkspace">
264
+ <USeparator class="my-0.5" />
265
+ <UButton
266
+ color="primary"
267
+ variant="ghost"
268
+ size="sm"
269
+ icon="i-ph-plus"
270
+ class="justify-start"
271
+ :disabled="!!switchingId"
272
+ @click="openCreateModal"
273
+ >
274
+ {{ $t(`${KEYS}.create`) }}
275
+ </UButton>
276
+ </template>
293
277
  </div>
294
278
  </template>
295
279
  </UPopover>
296
280
 
297
281
  <UModal
298
282
  v-model:open="isCreateOpen"
299
- :title="$t('saas.workspaces.create.title')"
300
- :description="$t('saas.workspaces.create.self_serve.description')"
283
+ :title="$t('saas.workspace.create.title')"
284
+ :description="$t('saas.workspace.create.description')"
301
285
  >
302
286
  <template #body>
303
287
  <DmsSaasWorkspaceCreateModal
@@ -1,141 +1,143 @@
1
- const BILLING_INFO_ENDPOINT = "/api/saas/tenant/billing-info";
2
- const BUSINESS_CUSTOMER_TYPE = "business";
3
- const COUNTRY_CODE_PATTERN = /^[A-Z]{2}$/;
4
- const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1
+ const BILLING_INFO_ENDPOINT = '/api/saas/tenant/billing-info'
2
+ const BUSINESS_CUSTOMER_TYPE = 'business'
3
+ const COUNTRY_CODE_PATTERN = /^[A-Z]{2}$/
4
+ const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
5
5
 
6
- export type CustomerType = "individual" | "business";
7
- export type VatVerificationStatus = "pending" | "verified" | "unverified";
6
+ export type CustomerType = 'individual' | 'business'
7
+ export type VatVerificationStatus = 'pending' | 'verified' | 'unverified'
8
8
 
9
9
  export type BillingIdentityField =
10
- | "customerType"
11
- | "companyName"
12
- | "country"
13
- | "line1"
14
- | "postalCode"
15
- | "city"
16
- | "billingEmail";
10
+ | 'customerType'
11
+ | 'companyName'
12
+ | 'country'
13
+ | 'line1'
14
+ | 'postalCode'
15
+ | 'city'
16
+ | 'billingEmail'
17
17
 
18
18
  /** The editable billing identity, as the form holds it. */
19
19
  export interface BillingIdentityDraft {
20
- customerType: CustomerType | null;
21
- companyName: string;
22
- vatNumber: string;
23
- billingEmail: string;
24
- country: string;
25
- line1: string;
26
- postalCode: string;
27
- city: string;
20
+ customerType: CustomerType | null
21
+ companyName: string
22
+ vatNumber: string
23
+ billingEmail: string
24
+ country: string
25
+ line1: string
26
+ postalCode: string
27
+ city: string
28
28
  }
29
29
 
30
30
  interface BillingAddress {
31
- line1: string | null;
32
- line2: string | null;
33
- postalCode: string | null;
34
- city: string | null;
35
- state: string | null;
36
- country: string | null;
31
+ line1: string | null
32
+ line2: string | null
33
+ postalCode: string | null
34
+ city: string | null
35
+ state: string | null
36
+ country: string | null
37
37
  }
38
38
 
39
39
  export interface BillingInfoResponse {
40
- customerType: CustomerType | null;
41
- companyName: string | null;
42
- vatNumber: string | null;
43
- vatVerificationStatus: VatVerificationStatus | null;
44
- billingEmail: string | null;
45
- address: BillingAddress | null;
46
- missingFields: BillingIdentityField[];
40
+ customerType: CustomerType | null
41
+ companyName: string | null
42
+ vatNumber: string | null
43
+ vatVerificationStatus: VatVerificationStatus | null
44
+ billingEmail: string | null
45
+ address: BillingAddress | null
46
+ missingFields: BillingIdentityField[]
47
+ /** When the identity was last saved; null before the first save. */
48
+ updatedAt?: string | null
47
49
  }
48
50
 
49
- type FieldCheck = (draft: BillingIdentityDraft) => boolean;
51
+ type FieldCheck = (draft: BillingIdentityDraft) => boolean
50
52
 
51
53
  function isFilled(value: string): boolean {
52
- return value.trim().length > 0;
54
+ return value.trim().length > 0
53
55
  }
54
56
 
55
57
  // Mirrors the server-side rules (src/workspaces/billing-identity.ts): the
56
58
  // form flags a field before the request, the server refuses it regardless.
57
59
  const FIELD_CHECKS: Record<BillingIdentityField, FieldCheck> = {
58
- customerType: (draft) => draft.customerType !== null,
59
- companyName: (draft) =>
60
- draft.customerType !== BUSINESS_CUSTOMER_TYPE ||
61
- isFilled(draft.companyName),
62
- country: (draft) => COUNTRY_CODE_PATTERN.test(draft.country.trim()),
63
- line1: (draft) => isFilled(draft.line1),
64
- postalCode: (draft) => isFilled(draft.postalCode),
65
- city: (draft) => isFilled(draft.city),
66
- billingEmail: (draft) => EMAIL_PATTERN.test(draft.billingEmail.trim()),
67
- };
60
+ customerType: (draft) => draft.customerType !== null,
61
+ companyName: (draft) =>
62
+ draft.customerType !== BUSINESS_CUSTOMER_TYPE ||
63
+ isFilled(draft.companyName),
64
+ country: (draft) => COUNTRY_CODE_PATTERN.test(draft.country.trim()),
65
+ line1: (draft) => isFilled(draft.line1),
66
+ postalCode: (draft) => isFilled(draft.postalCode),
67
+ city: (draft) => isFilled(draft.city),
68
+ billingEmail: (draft) => EMAIL_PATTERN.test(draft.billingEmail.trim()),
69
+ }
68
70
 
69
71
  /**
70
72
  * Required fields still missing or malformed, in form order; empty when the
71
73
  * identity can be saved. The VAT number is optional, even for a business.
72
74
  */
73
75
  export function findMissingBillingFields(
74
- draft: BillingIdentityDraft,
76
+ draft: BillingIdentityDraft,
75
77
  ): BillingIdentityField[] {
76
- return (Object.keys(FIELD_CHECKS) as BillingIdentityField[]).filter(
77
- (field) => !FIELD_CHECKS[field](draft),
78
- );
78
+ return (Object.keys(FIELD_CHECKS) as BillingIdentityField[]).filter(
79
+ (field) => !FIELD_CHECKS[field](draft),
80
+ )
79
81
  }
80
82
 
81
83
  export function emptyBillingIdentityDraft(): BillingIdentityDraft {
82
- return {
83
- customerType: null,
84
- companyName: "",
85
- vatNumber: "",
86
- billingEmail: "",
87
- country: "",
88
- line1: "",
89
- postalCode: "",
90
- city: "",
91
- };
84
+ return {
85
+ customerType: null,
86
+ companyName: '',
87
+ vatNumber: '',
88
+ billingEmail: '',
89
+ country: '',
90
+ line1: '',
91
+ postalCode: '',
92
+ city: '',
93
+ }
92
94
  }
93
95
 
94
96
  export function toBillingIdentityDraft(
95
- info: BillingInfoResponse,
97
+ info: BillingInfoResponse,
96
98
  ): BillingIdentityDraft {
97
- return {
98
- customerType: info.customerType,
99
- companyName: info.companyName ?? "",
100
- vatNumber: info.vatNumber ?? "",
101
- billingEmail: info.billingEmail ?? "",
102
- country: info.address?.country ?? "",
103
- line1: info.address?.line1 ?? "",
104
- postalCode: info.address?.postalCode ?? "",
105
- city: info.address?.city ?? "",
106
- };
99
+ return {
100
+ customerType: info.customerType,
101
+ companyName: info.companyName ?? '',
102
+ vatNumber: info.vatNumber ?? '',
103
+ billingEmail: info.billingEmail ?? '',
104
+ country: info.address?.country ?? '',
105
+ line1: info.address?.line1 ?? '',
106
+ postalCode: info.address?.postalCode ?? '',
107
+ city: info.address?.city ?? '',
108
+ }
107
109
  }
108
110
 
109
111
  function toRequestBody(draft: BillingIdentityDraft) {
110
- const isBusiness = draft.customerType === BUSINESS_CUSTOMER_TYPE;
111
- return {
112
- customerType: draft.customerType,
113
- companyName: isBusiness ? draft.companyName : null,
114
- vatNumber: isBusiness ? draft.vatNumber : null,
115
- billingEmail: draft.billingEmail,
116
- address: {
117
- country: draft.country,
118
- line1: draft.line1,
119
- postalCode: draft.postalCode,
120
- city: draft.city,
121
- },
122
- };
112
+ const isBusiness = draft.customerType === BUSINESS_CUSTOMER_TYPE
113
+ return {
114
+ customerType: draft.customerType,
115
+ companyName: isBusiness ? draft.companyName : null,
116
+ vatNumber: isBusiness ? draft.vatNumber : null,
117
+ billingEmail: draft.billingEmail,
118
+ address: {
119
+ country: draft.country,
120
+ line1: draft.line1,
121
+ postalCode: draft.postalCode,
122
+ city: draft.city,
123
+ },
124
+ }
123
125
  }
124
126
 
125
127
  /** Reads and saves the workspace billing identity. */
126
128
  export function useBillingIdentity() {
127
- const { $authFetch } = useAuthFetch();
129
+ const { $authFetch } = useAuthFetch()
128
130
 
129
- function load(): Promise<BillingInfoResponse> {
130
- return $authFetch<BillingInfoResponse>(BILLING_INFO_ENDPOINT);
131
- }
131
+ function load(): Promise<BillingInfoResponse> {
132
+ return $authFetch<BillingInfoResponse>(BILLING_INFO_ENDPOINT)
133
+ }
132
134
 
133
- function save(draft: BillingIdentityDraft): Promise<BillingInfoResponse> {
134
- return $authFetch<BillingInfoResponse>(BILLING_INFO_ENDPOINT, {
135
- method: "PUT",
136
- body: toRequestBody(draft),
137
- });
138
- }
135
+ function save(draft: BillingIdentityDraft): Promise<BillingInfoResponse> {
136
+ return $authFetch<BillingInfoResponse>(BILLING_INFO_ENDPOINT, {
137
+ method: 'PUT',
138
+ body: toRequestBody(draft),
139
+ })
140
+ }
139
141
 
140
- return { load, save };
142
+ return { load, save }
141
143
  }