@antelopejs/dms-saas 0.8.1 → 0.9.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 (311) hide show
  1. package/README.md +20 -4
  2. package/dist/auth/owner-only-permissions-resolver.js.map +1 -1
  3. package/dist/auth/plan-permissions-resolver.js.map +1 -1
  4. package/dist/automation/index.js.map +1 -1
  5. package/dist/billing-state/directory-hooks.js.map +1 -1
  6. package/dist/billing-state/directory.js.map +1 -1
  7. package/dist/billing-state/past-due-banner.js.map +1 -1
  8. package/dist/billing-state/recovery.js +2 -1
  9. package/dist/billing-state/recovery.js.map +1 -1
  10. package/dist/billing-state/trial-ending-banner.js.map +1 -1
  11. package/dist/crons/hard-delete-cancelled.js.map +1 -1
  12. package/dist/data-api/platformOwner/admin-user-workspaces.js +1 -1
  13. package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -1
  14. package/dist/data-api/platformOwner/credit-note-rows.d.ts +4 -4
  15. package/dist/data-api/platformOwner/credit-note-rows.js +2 -1
  16. package/dist/data-api/platformOwner/credit-note-rows.js.map +1 -1
  17. package/dist/data-api/platformOwner/credit-notes.d.ts +1 -1
  18. package/dist/data-api/platformOwner/credit-notes.js +1 -1
  19. package/dist/data-api/platformOwner/credit-notes.js.map +1 -1
  20. package/dist/data-api/platformOwner/features.js.map +1 -1
  21. package/dist/data-api/platformOwner/invitations.js.map +1 -1
  22. package/dist/data-api/platformOwner/invoice-cells.js.map +1 -1
  23. package/dist/data-api/platformOwner/invoice-rows.d.ts +5 -4
  24. package/dist/data-api/platformOwner/invoice-rows.js.map +1 -1
  25. package/dist/data-api/platformOwner/invoices.d.ts +5 -5
  26. package/dist/data-api/platformOwner/invoices.js +5 -4
  27. package/dist/data-api/platformOwner/invoices.js.map +1 -1
  28. package/dist/data-api/platformOwner/plan-migrations.js.map +1 -1
  29. package/dist/data-api/platformOwner/plans.d.ts +5 -5
  30. package/dist/data-api/platformOwner/plans.js.map +1 -1
  31. package/dist/data-api/platformOwner/segments.js.map +1 -1
  32. package/dist/data-api/platformOwner/table-scope.d.ts +2 -1
  33. package/dist/data-api/platformOwner/table-scope.js.map +1 -1
  34. package/dist/data-api/platformOwner/users.js +7 -6
  35. package/dist/data-api/platformOwner/users.js.map +1 -1
  36. package/dist/data-api/platformOwner/workspace-cells.d.ts +2 -2
  37. package/dist/data-api/platformOwner/workspace-cells.js +1 -1
  38. package/dist/data-api/platformOwner/workspace-cells.js.map +1 -1
  39. package/dist/data-api/platformOwner/workspaces.d.ts +6 -5
  40. package/dist/data-api/platformOwner/workspaces.js +7 -10
  41. package/dist/data-api/platformOwner/workspaces.js.map +1 -1
  42. package/dist/data-api/tenant/tenant-invoices.js.map +1 -1
  43. package/dist/frontend-module.js.map +1 -1
  44. package/dist/hooks/register.js.map +1 -1
  45. package/dist/hooks/tenant-export.js.map +1 -1
  46. package/dist/i18n/composed-text.js.map +1 -1
  47. package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/invoice-line-items/injection.d.ts +1 -1
  50. package/dist/invoice-line-items/injection.js.map +1 -1
  51. package/dist/invoice-line-items/recovery/discovery.js +11 -9
  52. package/dist/invoice-line-items/recovery/discovery.js.map +1 -1
  53. package/dist/invoice-line-items/recovery/managed-lines.js +18 -12
  54. package/dist/invoice-line-items/recovery/managed-lines.js.map +1 -1
  55. package/dist/metrics/activity-sources.js +1 -3
  56. package/dist/metrics/activity-sources.js.map +1 -1
  57. package/dist/metrics/activity.d.ts +3 -2
  58. package/dist/metrics/activity.js +19 -3
  59. package/dist/metrics/activity.js.map +1 -1
  60. package/dist/metrics/directory-summary.js +12 -4
  61. package/dist/metrics/directory-summary.js.map +1 -1
  62. package/dist/metrics/normalised-mrr.js.map +1 -1
  63. package/dist/metrics/revenue.d.ts +2 -2
  64. package/dist/metrics/revenue.js +3 -2
  65. package/dist/metrics/revenue.js.map +1 -1
  66. package/dist/operator-actions/commands.js +2 -1
  67. package/dist/operator-actions/commands.js.map +1 -1
  68. package/dist/operator-actions/db/lifecycle-delivery.model.js.map +1 -1
  69. package/dist/operator-actions/invitation-commands.d.ts +1 -1
  70. package/dist/operator-actions/invitation-commands.js +5 -27
  71. package/dist/operator-actions/invitation-commands.js.map +1 -1
  72. package/dist/operator-actions/journal.js +5 -2
  73. package/dist/operator-actions/journal.js.map +1 -1
  74. package/dist/operator-actions/lifecycle-consumers.js.map +1 -1
  75. package/dist/operator-actions/one-shot.d.ts +9 -0
  76. package/dist/operator-actions/one-shot.js +21 -0
  77. package/dist/operator-actions/one-shot.js.map +1 -0
  78. package/dist/operator-actions/types.d.ts +1 -1
  79. package/dist/operator-billing/billing-settings-store.js.map +1 -1
  80. package/dist/operator-billing/billing-stats.d.ts +2 -1
  81. package/dist/operator-billing/billing-stats.js +3 -2
  82. package/dist/operator-billing/billing-stats.js.map +1 -1
  83. package/dist/operator-billing/credit-allowance.d.ts +6 -3
  84. package/dist/operator-billing/credit-allowance.js.map +1 -1
  85. package/dist/operator-billing/credit-note-request.js.map +1 -1
  86. package/dist/operator-billing/invoice-credit.js +9 -3
  87. package/dist/operator-billing/invoice-credit.js.map +1 -1
  88. package/dist/operator-billing/legal-documents-store.js.map +1 -1
  89. package/dist/operator-billing/legal-versions.js +13 -8
  90. package/dist/operator-billing/legal-versions.js.map +1 -1
  91. package/dist/pages/platform/dashboard.js.map +1 -1
  92. package/dist/pages/platform/features.js.map +1 -1
  93. package/dist/pages/platform/plans/edit.js.map +1 -1
  94. package/dist/pages/platform/plans/index.js.map +1 -1
  95. package/dist/pages/platform/plans/migrations.js.map +1 -1
  96. package/dist/pages/platform/users/detail.js.map +1 -1
  97. package/dist/pages/platform/users/index.js.map +1 -1
  98. package/dist/pages/platform/workspaces/detail.js.map +1 -1
  99. package/dist/pages/platform/workspaces/index.js.map +1 -1
  100. package/dist/pages/public/index.js.map +1 -1
  101. package/dist/pages/public/legal/privacy-policy.js.map +1 -1
  102. package/dist/pages/public/legal/terms-and-conditions.js.map +1 -1
  103. package/dist/pages/public/legal/terms-of-use.js.map +1 -1
  104. package/dist/pages/public/pricing.js.map +1 -1
  105. package/dist/pages/public/register.js.map +1 -1
  106. package/dist/pages/public/screens.js +5 -2
  107. package/dist/pages/public/screens.js.map +1 -1
  108. package/dist/pages/tenant/billing.js.map +1 -1
  109. package/dist/pages/tenant/general.js.map +1 -1
  110. package/dist/pages/tenant/members-seat-quota.js.map +1 -1
  111. package/dist/pages/tenant/workspace-suspended.js.map +1 -1
  112. package/dist/plan-changes/applied-upgrade.d.ts +1 -1
  113. package/dist/plan-changes/applied-upgrade.js.map +1 -1
  114. package/dist/plan-changes/deferred.js.map +1 -1
  115. package/dist/plan-changes/guarded-free.js.map +1 -1
  116. package/dist/plan-changes/guarded-landing.js.map +1 -1
  117. package/dist/plan-changes/inventory-barrier.js.map +1 -1
  118. package/dist/plans/migration-blocks.js +6 -6
  119. package/dist/plans/migration-blocks.js.map +1 -1
  120. package/dist/plans/migration-dialogs.js.map +1 -1
  121. package/dist/plans/plan-diff.js +2 -1
  122. package/dist/plans/plan-diff.js.map +1 -1
  123. package/dist/plans/plan-permission-tree.js.map +1 -1
  124. package/dist/plans/plan-write.js +9 -7
  125. package/dist/plans/plan-write.js.map +1 -1
  126. package/dist/plans/seat-hooks.js.map +1 -1
  127. package/dist/plans/stripe-sync.js.map +1 -1
  128. package/dist/routes/platformOwner/dashboard.d.ts +2 -1
  129. package/dist/routes/platformOwner/dashboard.js.map +1 -1
  130. package/dist/routes/platformOwner/plan-deletion.js.map +1 -1
  131. package/dist/routes/platformOwner/plan-dialogs.d.ts +3 -2
  132. package/dist/routes/platformOwner/plan-dialogs.js.map +1 -1
  133. package/dist/routes/platformOwner/plan-migrations.d.ts +4 -2
  134. package/dist/routes/platformOwner/plan-migrations.js +2 -1
  135. package/dist/routes/platformOwner/plan-migrations.js.map +1 -1
  136. package/dist/routes/platformOwner/plans.d.ts +3 -2
  137. package/dist/routes/platformOwner/plans.js.map +1 -1
  138. package/dist/routes/platformOwner/platform-notes.js +3 -3
  139. package/dist/routes/platformOwner/platform-notes.js.map +1 -1
  140. package/dist/routes/platformOwner/segments-export.js.map +1 -1
  141. package/dist/routes/platformOwner/segments.js +2 -3
  142. package/dist/routes/platformOwner/segments.js.map +1 -1
  143. package/dist/routes/platformOwner/workspace-detail.d.ts +6 -2
  144. package/dist/routes/platformOwner/workspace-detail.js +10 -1
  145. package/dist/routes/platformOwner/workspace-detail.js.map +1 -1
  146. package/dist/routes/platformOwner/workspace-operator-actions.d.ts +2 -1
  147. package/dist/routes/platformOwner/workspace-operator-actions.js +4 -4
  148. package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
  149. package/dist/routes/platformOwner/workspaces-admin.d.ts +4 -2
  150. package/dist/routes/platformOwner/workspaces-admin.js +30 -7
  151. package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
  152. package/dist/routes/public/pricing.d.ts +2 -1
  153. package/dist/routes/public/pricing.js.map +1 -1
  154. package/dist/routes/public/public-plan-catalog.d.ts +2 -1
  155. package/dist/routes/public/public-plan-catalog.js +2 -1
  156. package/dist/routes/public/public-plan-catalog.js.map +1 -1
  157. package/dist/routes/public/register.d.ts +6 -3
  158. package/dist/routes/public/register.js +2 -1
  159. package/dist/routes/public/register.js.map +1 -1
  160. package/dist/routes/tenant/billing-pay-invoice.js.map +1 -1
  161. package/dist/routes/tenant/billing-portal.js.map +1 -1
  162. package/dist/routes/tenant/billing-self-refund.js.map +1 -1
  163. package/dist/routes/tenant/data-export.js.map +1 -1
  164. package/dist/routes/tenant/tenant-billing.js.map +1 -1
  165. package/dist/routes/tenant/tenant-plan-authentication.js.map +1 -1
  166. package/dist/routes/tenant/tenant-plan-cancellation.js.map +1 -1
  167. package/dist/routes/tenant/tenant-plan-checkout-recovery.js.map +1 -1
  168. package/dist/routes/tenant/tenant-plan-checkout.js +2 -3
  169. package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
  170. package/dist/routes/tenant/tenant-plan-ops.js.map +1 -1
  171. package/dist/routes/tenant/tenant-plan-preview.js.map +1 -1
  172. package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -1
  173. package/dist/routes/tenant/tenant-plan.d.ts +5 -3
  174. package/dist/routes/tenant/tenant-plan.js +4 -3
  175. package/dist/routes/tenant/tenant-plan.js.map +1 -1
  176. package/dist/routes/tenant/tenant-upcoming-invoice.js +2 -3
  177. package/dist/routes/tenant/tenant-upcoming-invoice.js.map +1 -1
  178. package/dist/routes/tenant/workspaces.d.ts +2 -1
  179. package/dist/routes/tenant/workspaces.js.map +1 -1
  180. package/dist/stripe/client.js +2 -1
  181. package/dist/stripe/client.js.map +1 -1
  182. package/dist/stripe/customer-billing.d.ts +1 -1
  183. package/dist/stripe/customer-billing.js +1 -1
  184. package/dist/stripe/customer-billing.js.map +1 -1
  185. package/dist/stripe/payload-shapes.d.ts +20 -5
  186. package/dist/stripe/payload-shapes.js +4 -4
  187. package/dist/stripe/payload-shapes.js.map +1 -1
  188. package/dist/stripe/pending-update.js +2 -1
  189. package/dist/stripe/pending-update.js.map +1 -1
  190. package/dist/stripe/plan-schedule.js +3 -2
  191. package/dist/stripe/plan-schedule.js.map +1 -1
  192. package/dist/stripe/sync-plan.js +9 -8
  193. package/dist/stripe/sync-plan.js.map +1 -1
  194. package/dist/stripe/webhook-checkout.d.ts +2 -2
  195. package/dist/stripe/webhook-checkout.js +5 -4
  196. package/dist/stripe/webhook-checkout.js.map +1 -1
  197. package/dist/stripe/webhook-credit-notes.d.ts +2 -2
  198. package/dist/stripe/webhook-credit-notes.js +2 -1
  199. package/dist/stripe/webhook-credit-notes.js.map +1 -1
  200. package/dist/stripe/webhook-dispatch.js +6 -2
  201. package/dist/stripe/webhook-dispatch.js.map +1 -1
  202. package/dist/stripe/webhook-handlers.d.ts +10 -10
  203. package/dist/stripe/webhook-handlers.js.map +1 -1
  204. package/dist/stripe/webhook-shared.d.ts +1 -1
  205. package/dist/stripe/webhook-shared.js +2 -1
  206. package/dist/stripe/webhook-shared.js.map +1 -1
  207. package/dist/stripe/workspace-checkout.js +2 -1
  208. package/dist/stripe/workspace-checkout.js.map +1 -1
  209. package/dist/upcoming-invoice/eligibility.js.map +1 -1
  210. package/dist/upcoming-invoice/preview.js.map +1 -1
  211. package/dist/upcoming-invoice/pricing.js +6 -2
  212. package/dist/upcoming-invoice/pricing.js.map +1 -1
  213. package/dist/users/user-facts.js.map +1 -1
  214. package/dist/utils/content-language.d.ts +3 -1
  215. package/dist/utils/content-language.js +2 -1
  216. package/dist/utils/content-language.js.map +1 -1
  217. package/dist/utils/keyed-insert.d.ts +3 -7
  218. package/dist/utils/keyed-insert.js.map +1 -1
  219. package/dist/utils/parse-future-date.js +2 -1
  220. package/dist/utils/parse-future-date.js.map +1 -1
  221. package/dist/utils/primitive-guards.d.ts +4 -0
  222. package/dist/utils/primitive-guards.js +19 -0
  223. package/dist/utils/primitive-guards.js.map +1 -0
  224. package/dist/utils/query-parameter.d.ts +1 -0
  225. package/dist/utils/query-parameter.js +3 -0
  226. package/dist/utils/query-parameter.js.map +1 -0
  227. package/dist/utils/row-instance.js.map +1 -1
  228. package/dist/utils/segment-conditions-type.js +2 -1
  229. package/dist/utils/segment-conditions-type.js.map +1 -1
  230. package/dist/utils/segment-evaluator.js +8 -7
  231. package/dist/utils/segment-evaluator.js.map +1 -1
  232. package/dist/utils/segment-explain.js +2 -1
  233. package/dist/utils/segment-explain.js.map +1 -1
  234. package/dist/utils/segment-matching.js.map +1 -1
  235. package/dist/utils/segment-validation.js +12 -13
  236. package/dist/utils/segment-validation.js.map +1 -1
  237. package/dist/utils/time.js +2 -1
  238. package/dist/utils/time.js.map +1 -1
  239. package/dist/workers/plan-migration.js.map +1 -1
  240. package/dist/workspaces/billing-identity.d.ts +3 -1
  241. package/dist/workspaces/billing-identity.js +10 -1
  242. package/dist/workspaces/billing-identity.js.map +1 -1
  243. package/dist/workspaces/default-plan.js.map +1 -1
  244. package/dist/workspaces/deletion.js.map +1 -1
  245. package/dist/workspaces/detail-items.js.map +1 -1
  246. package/dist/workspaces/operator-creation.js +2 -3
  247. package/dist/workspaces/operator-creation.js.map +1 -1
  248. package/dist/workspaces/owner-invitation-email.js.map +1 -1
  249. package/dist/workspaces/provisioning-types.d.ts +46 -0
  250. package/dist/workspaces/provisioning-types.js +3 -0
  251. package/dist/workspaces/provisioning-types.js.map +1 -0
  252. package/dist/workspaces/provisioning.d.ts +3 -45
  253. package/dist/workspaces/provisioning.js.map +1 -1
  254. package/dist/workspaces/registration-extras.js +13 -9
  255. package/dist/workspaces/registration-extras.js.map +1 -1
  256. package/dist/workspaces/self-serve-creation.js.map +1 -1
  257. package/dist/workspaces/subscription-create-params.js.map +1 -1
  258. package/frontend-vue/app/build/PayInvoicePanel.vue +3 -2
  259. package/frontend-vue/app/build/PlanChangeReview.vue +7 -6
  260. package/frontend-vue/app/build/components/RetirePlanDiff.vue +178 -0
  261. package/frontend-vue/app/build/public/OtherWorkspaces.vue +4 -11
  262. package/frontend-vue/app/build/public/registration-errors.ts +2 -0
  263. package/frontend-vue/app/build/workspace-detail/ComplimentaryDialog.vue +7 -5
  264. package/frontend-vue/app/build/workspace-detail/CreditDialog.vue +5 -4
  265. package/frontend-vue/app/build/workspace-detail/UpgradeDialog.vue +7 -5
  266. package/frontend-vue/app/build/workspace-detail/types.ts +1 -1
  267. package/frontend-vue/app/build/workspace-detail/useWorkspaceActions.ts +2 -7
  268. package/frontend-vue/app/build/workspace-paths.ts +12 -0
  269. package/frontend-vue/app/components/CustomerPortalButton.vue +4 -2
  270. package/frontend-vue/app/components/DataExport.vue +14 -14
  271. package/frontend-vue/app/components/DataExportHistory.vue +7 -12
  272. package/frontend-vue/app/components/IssueCreditNoteModal.vue +4 -7
  273. package/frontend-vue/app/components/LegalLayout.vue +5 -4
  274. package/frontend-vue/app/components/MigrationStripeCheck.vue +2 -5
  275. package/frontend-vue/app/components/PendingCheckoutModal.vue +2 -7
  276. package/frontend-vue/app/components/PlanTaxSync.vue +2 -6
  277. package/frontend-vue/app/components/PlanUpgradeModal.vue +10 -11
  278. package/frontend-vue/app/components/PlatformNotes.vue +4 -8
  279. package/frontend-vue/app/components/Pricing.vue +4 -2
  280. package/frontend-vue/app/components/RefundButton.vue +4 -2
  281. package/frontend-vue/app/components/RetirePlanModal.vue +16 -165
  282. package/frontend-vue/app/components/TenantBillingForm.vue +3 -7
  283. package/frontend-vue/app/components/TenantPlanCard.vue +11 -18
  284. package/frontend-vue/app/components/UserPlatformRoleCard.vue +2 -5
  285. package/frontend-vue/app/components/WorkspaceAdminCreateModal.vue +5 -3
  286. package/frontend-vue/app/components/WorkspaceCreateModal.vue +12 -5
  287. package/frontend-vue/app/components/WorkspaceDangerZone.vue +8 -3
  288. package/frontend-vue/app/components/WorkspaceDetailHeader.vue +16 -13
  289. package/frontend-vue/app/components/WorkspaceInvitationLink.vue +3 -2
  290. package/frontend-vue/app/components/WorkspaceOperatorActions.vue +17 -4
  291. package/frontend-vue/app/components/WorkspaceSuspended.vue +6 -13
  292. package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +21 -15
  293. package/frontend-vue/app/composables/useApiErrorMessage.ts +4 -33
  294. package/frontend-vue/app/composables/useInvitationLink.ts +14 -11
  295. package/frontend-vue/app/composables/useSaasRegistration.ts +14 -72
  296. package/frontend-vue/app/composables/useSaasRegistrationPlan.ts +73 -0
  297. package/frontend-vue/app/custom-pages/auth/no-workspace.vue +14 -11
  298. package/frontend-vue/build/backend-boundary.ts +122 -0
  299. package/frontend-vue/dms.frontend.build.ts +2 -0
  300. package/frontend-vue/i18n/locales/saas-operator-dashboard-en-GB.json +66 -0
  301. package/frontend-vue/i18n/locales/saas-operator-dashboard-fr-FR.json +66 -0
  302. package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +13 -65
  303. package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +13 -65
  304. package/frontend-vue/i18n/locales/saas-public-en-GB.json +2 -4
  305. package/frontend-vue/i18n/locales/saas-public-fr-FR.json +2 -4
  306. package/frontend-vue/i18n/locales/saas-tenant-workspace-en-GB.json +0 -1
  307. package/frontend-vue/i18n/locales/saas-tenant-workspace-fr-FR.json +0 -1
  308. package/frontend-vue/package.json +1 -1
  309. package/package.json +10 -11
  310. package/skills/dms-saas/SKILL.md +2 -3
  311. package/skills/dms-saas/cases.json +48 -0
@@ -11,11 +11,15 @@ const FORBIDDEN_KEYS = ["__proto__", "constructor", "prototype"];
11
11
  const INVALID_ERROR = "saas.errors.registration.extras_invalid";
12
12
  const TOO_LARGE_ERROR = "saas.errors.registration.extras_too_large";
13
13
  const TOO_COMPLEX_ERROR = "saas.errors.registration.extras_too_complex";
14
- const EMPTY_SHAPE = { keys: 0, depth: 0, hasForbiddenKey: false };
14
+ const EMPTY_FOOTPRINT = {
15
+ keys: 0,
16
+ depth: 0,
17
+ hasForbiddenKey: false,
18
+ };
15
19
  function isPlainObject(value) {
16
20
  return typeof value === "object" && value !== null && !Array.isArray(value);
17
21
  }
18
- function mergeShapes(left, right) {
22
+ function mergeFootprints(left, right) {
19
23
  return {
20
24
  keys: left.keys + right.keys,
21
25
  depth: Math.max(left.depth, right.depth),
@@ -26,25 +30,25 @@ function inspect(value, depth) {
26
30
  if (Array.isArray(value)) {
27
31
  return value
28
32
  .map((entry) => inspect(entry, depth + 1))
29
- .reduce(mergeShapes, { ...EMPTY_SHAPE, depth });
33
+ .reduce(mergeFootprints, { ...EMPTY_FOOTPRINT, depth });
30
34
  }
31
35
  if (!isPlainObject(value))
32
- return EMPTY_SHAPE;
36
+ return EMPTY_FOOTPRINT;
33
37
  return Object.entries(value)
34
- .map(([key, nested]) => mergeShapes(inspect(nested, depth + 1), {
38
+ .map(([key, nested]) => mergeFootprints(inspect(nested, depth + 1), {
35
39
  keys: 1,
36
40
  depth,
37
41
  hasForbiddenKey: FORBIDDEN_KEYS.includes(key),
38
42
  }))
39
- .reduce(mergeShapes, { ...EMPTY_SHAPE, depth });
43
+ .reduce(mergeFootprints, { ...EMPTY_FOOTPRINT, depth });
40
44
  }
41
45
  function assertRegistrationExtras(extras) {
42
46
  if (extras === undefined || extras === null)
43
47
  return;
44
48
  (0, interface_api_util_1.assert)(isPlainObject(extras), HTTP_BAD_REQUEST, INVALID_ERROR);
45
49
  (0, interface_api_util_1.assert)(Buffer.byteLength(JSON.stringify(extras), "utf8") <= MAX_SERIALISED_BYTES, HTTP_BAD_REQUEST, TOO_LARGE_ERROR);
46
- const shape = inspect(extras, 1);
47
- (0, interface_api_util_1.assert)(!shape.hasForbiddenKey, HTTP_BAD_REQUEST, INVALID_ERROR);
48
- (0, interface_api_util_1.assert)(shape.keys <= MAX_KEYS && shape.depth <= MAX_DEPTH, HTTP_BAD_REQUEST, TOO_COMPLEX_ERROR);
50
+ const footprint = inspect(extras, 1);
51
+ (0, interface_api_util_1.assert)(!footprint.hasForbiddenKey, HTTP_BAD_REQUEST, INVALID_ERROR);
52
+ (0, interface_api_util_1.assert)(footprint.keys <= MAX_KEYS && footprint.depth <= MAX_DEPTH, HTTP_BAD_REQUEST, TOO_COMPLEX_ERROR);
49
53
  }
50
54
  //# sourceMappingURL=registration-extras.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registration-extras.js","sourceRoot":"","sources":["../../src/workspaces/registration-extras.ts"],"names":[],"mappings":";;AA0EA,4DAgBC;AA1FD,uEAAwD;AACxD,8EAAyF;AAEzF,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAU7B,MAAM,oBAAoB,GAAG,yCAA0B,CAAC,kBAAkB,CAAC;AAC3E,MAAM,QAAQ,GAAG,yCAA0B,CAAC,OAAO,CAAC;AACpD,MAAM,SAAS,GAAG,yCAA0B,CAAC,QAAQ,CAAC;AAGtD,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AAEjE,MAAM,aAAa,GAAG,yCAAyC,CAAC;AAChE,MAAM,eAAe,GAAG,2CAA2C,CAAC;AACpE,MAAM,iBAAiB,GAAG,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S,cAAc,CAAC,KAAgC;IACtD,IAAA,2BAAM,EACJ,KAAK,EACL,gBAAgB,EAChB,+CAA+C,CAChD,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAGX;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE;QAC3D,cAAc,CAAC,eAAe,CAAC,CAAC;QAChC,oBAAoB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IACnC,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,EAAE;QACvE,cAAc,CAAC,eAAe,CAAC,CAAC;QAChC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,IAAA,yDAA8B,EAClC,IAAI,CAAC,WAAqB,EAC1B,qBAAqB,CACtB,CAAC;QACF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;CAClE,CAAC;AAYF,SAAgB,uBAAuB,CACrC,KAAyB;IAEzB,OAAO,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"self-serve-creation.js","sourceRoot":"","sources":["../../src/workspaces/self-serve-creation.ts"],"names":[],"mappings":";;AAuFA,8CASC;AA6ED,kEAqBC;AA8DD,0DAIC;AApQD,uEAAwD;AACxD,uEAAgE;AAChE,6FAAqE;AACrE,qDAA8E;AAE9E,8BAOe;AACf,6CAAsD;AACtD,oCAAqC;AACrC,uDAAyE;AACzE,2CAAyC;AACzC,yEAIoC;AAMpC,0DAAyD;AACzD,gEAAoE;AAEpE,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,MAAM,CAAC,CAAC;QACjE,WAAW,EAAE,MAAM,sBAAsB,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;KAC3D,CAAC;AACJ,CAAC;AAqBD,SAAS,cAAc,CACrB,KAAgC;IAEhC,IAAA,2BAAM,EACJ,KAAK,EACL,gBAAgB,EAChB,+CAA+C,CAChD,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAGX;IACF,OAAO,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE;QAC3D,cAAc,CAAC,eAAe,CAAC,CAAC;QAChC,oBAAoB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IACnC,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,EAAE;QACvE,cAAc,CAAC,eAAe,CAAC,CAAC;QAChC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,IAAA,yDAA8B,EAClC,IAAI,CAAC,WAAW,EAChB,qBAAqB,CACtB,CAAC;QACF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;CAClE,CAAC;AAYF,SAAgB,uBAAuB,CACrC,KAAyB;IAEzB,OAAO,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"subscription-create-params.js","sourceRoot":"","sources":["../../src/workspaces/subscription-create-params.ts"],"names":[],"mappings":";;AAOA,sEAqBC;AA1BD,yDAAmE;AAEnE,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAGxC,SAAgB,6BAA6B,CAC3C,gBAAwB,EACxB,aAAqB,EACrB,IAAU,EACV,UAAmB;IAEnB,MAAM,QAAQ,GACZ,IAAI,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,OAAO;QACL,QAAQ,EAAE,gBAAgB;QAC1B,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;QAC3C,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC1D,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAChC,YAAY,EAAE,wCAAyB;QAMvC,gBAAgB,EAAE,oBAAoB;KACvC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"subscription-create-params.js","sourceRoot":"","sources":["../../src/workspaces/subscription-create-params.ts"],"names":[],"mappings":";;AAcA,sEAgBC;AA5BD,yDAAmE;AAEnE,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAUxC,SAAgB,6BAA6B,CAC3C,gBAAwB,EACxB,aAAqB,EACrB,IAAU,EACV,UAAmB;IAEnB,MAAM,QAAQ,GACZ,IAAI,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,OAAO;QACL,QAAQ,EAAE,gBAAgB;QAC1B,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;QAC3C,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC1D,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAChC,YAAY,EAAE,wCAAyB;QACvC,gBAAgB,EAAE,oBAAoB;KACvC,CAAC;AACJ,CAAC"}
@@ -17,7 +17,7 @@ const DAY_FORMAT: Intl.DateTimeFormatOptions = {
17
17
 
18
18
  const { t, locale } = useI18n()
19
19
  const toast = useToast()
20
- const { resolveApiError } = useApiErrorMessage()
20
+ const { resolveError } = useApiErrorPresenter()
21
21
  const { formatMinorUnits } = useMoneyFormat()
22
22
  const { payWithDefaultCard } = usePayInvoice()
23
23
  const billingStatus = useBillingStatus()
@@ -69,7 +69,8 @@ async function payWithCard(): Promise<void> {
69
69
  await refreshPageBlocks()
70
70
  emit('paid')
71
71
  } catch (error) {
72
- failure.value = resolveApiError(error, `${KEY_PREFIX}.error`)
72
+ failure.value =
73
+ resolveError(error, { fallbackKey: `${KEY_PREFIX}.error` })?.message ?? ''
73
74
  } finally {
74
75
  isPaying.value = false
75
76
  }
@@ -26,7 +26,7 @@ const KEY_PREFIX = 'saas.tenant_billing.plan_change.review'
26
26
 
27
27
  const { t, locale } = useI18n()
28
28
  const toast = useToast()
29
- const { resolveApiError } = useApiErrorMessage()
29
+ const { resolveError } = useApiErrorPresenter()
30
30
  const { previewChange, changePlan } = useTenantPlanChanges()
31
31
  const { offerFor: offerPendingCheckout } = usePendingCheckout()
32
32
  const { formatMinorUnits, formatMajorUnits } = useMoneyFormat()
@@ -197,7 +197,9 @@ async function loadPreview(): Promise<void> {
197
197
  preview.value = null
198
198
  incompatibilities.value = readPlanChangeIncompatibilities(error)
199
199
  if (!incompatibilities.value) {
200
- loadFailure.value = resolveApiError(error, `${KEY_PREFIX}.load_failed`)
200
+ loadFailure.value =
201
+ resolveError(error, { fallbackKey: `${KEY_PREFIX}.load_failed` })
202
+ ?.message ?? ''
201
203
  }
202
204
  } finally {
203
205
  isLoading.value = false
@@ -230,10 +232,9 @@ async function confirm(): Promise<void> {
230
232
  preview.value = null
231
233
  return
232
234
  }
233
- submitFailure.value = resolveApiError(
234
- error,
235
- 'saas.workspace.plan.change_error',
236
- )
235
+ submitFailure.value =
236
+ resolveError(error, { fallbackKey: 'saas.workspace.plan.change_error' })
237
+ ?.message ?? ''
237
238
  } finally {
238
239
  isSubmitting.value = false
239
240
  }
@@ -0,0 +1,178 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * What moving a retired plan's workspaces onto the target changes: each
4
+ * feature that differs, the member cap, the permissions, and the features
5
+ * left as they were.
6
+ */
7
+ import { computed } from 'vue'
8
+ import {
9
+ type CatalogFeature,
10
+ isFeatureIncluded,
11
+ PLAN_UNLIMITED,
12
+ } from '../plan-catalog'
13
+ import {
14
+ changedFeatures,
15
+ type PlanChangeKind,
16
+ type RetireFeatureChange,
17
+ type RetirePreparation,
18
+ unchangedFeatureIds,
19
+ } from '../plan-retire'
20
+
21
+ const KIND_ICONS: Record<PlanChangeKind, string> = {
22
+ lost: 'i-ph-minus-circle',
23
+ gained: 'i-ph-plus-circle',
24
+ changed: 'i-ph-arrows-left-right',
25
+ same: 'i-ph-equals',
26
+ }
27
+
28
+ const KIND_CLASSES: Record<PlanChangeKind, string> = {
29
+ lost: 'text-error',
30
+ gained: 'text-success',
31
+ changed: 'text-info',
32
+ same: 'text-muted',
33
+ }
34
+
35
+ const props = defineProps<{
36
+ preparation: RetirePreparation
37
+ features: CatalogFeature[]
38
+ planName: string
39
+ targetName: string
40
+ }>()
41
+
42
+ const { t } = useI18n()
43
+ const { formatFeatureValue } = usePlanFeatureFormat()
44
+
45
+ const featuresById = computed(
46
+ () => new Map(props.features.map((feature) => [feature._id, feature])),
47
+ )
48
+ const changes = computed(() => changedFeatures(props.preparation.features))
49
+ const unchanged = computed(() =>
50
+ unchangedFeatureIds(props.preparation.features)
51
+ .map((id) => featuresById.value.get(id)?.displayName)
52
+ .filter((name): name is string => !!name),
53
+ )
54
+
55
+ function readValue(change: RetireFeatureChange, value: unknown): string {
56
+ const feature = featuresById.value.get(change.featureId)
57
+ if (
58
+ !feature ||
59
+ feature.valueType === 'boolean' ||
60
+ !isFeatureIncluded(value)
61
+ ) {
62
+ return isFeatureIncluded(value)
63
+ ? t('saas.catalog.retire.included')
64
+ : t('saas.catalog.retire.not_included')
65
+ }
66
+ return formatFeatureValue({ ...feature, featureId: feature._id }, value)
67
+ }
68
+
69
+ function featureName(featureId: string): string {
70
+ return featuresById.value.get(featureId)?.displayName ?? featureId
71
+ }
72
+
73
+ function memberCap(value: number): string {
74
+ return value === PLAN_UNLIMITED
75
+ ? t('saas.catalog.plans.unlimited')
76
+ : String(value)
77
+ }
78
+ </script>
79
+
80
+ <template>
81
+ <DmsCard :padded="false">
82
+ <div
83
+ class="border-default flex items-center justify-between border-b px-4 py-2.5"
84
+ >
85
+ <span class="text-muted text-xs font-semibold uppercase">
86
+ {{ $t('saas.catalog.retire.diff_title') }}
87
+ </span>
88
+ <span class="text-dimmed text-xs">{{ planName }} → {{ targetName }}</span>
89
+ </div>
90
+ <ul class="divide-default divide-y text-sm">
91
+ <li
92
+ v-for="change in changes"
93
+ :key="change.featureId"
94
+ class="flex items-center gap-2 px-4 py-2"
95
+ >
96
+ <UIcon
97
+ :name="KIND_ICONS[change.kind]"
98
+ class="size-4 shrink-0"
99
+ :class="KIND_CLASSES[change.kind]"
100
+ />
101
+ <span class="min-w-0 flex-1 truncate">
102
+ {{ featureName(change.featureId) }}
103
+ </span>
104
+ <span class="text-muted text-xs">
105
+ {{ readValue(change, change.from) }} →
106
+ <b class="text-default">
107
+ {{ readValue(change, change.to) }}
108
+ </b>
109
+ </span>
110
+ </li>
111
+ <li
112
+ v-if="preparation.members.kind !== 'same'"
113
+ class="flex flex-wrap items-center gap-2 px-4 py-2"
114
+ >
115
+ <UIcon
116
+ :name="KIND_ICONS[preparation.members.kind]"
117
+ class="size-4 shrink-0"
118
+ :class="KIND_CLASSES[preparation.members.kind]"
119
+ />
120
+ <span class="flex-1">
121
+ {{ $t('saas.catalog.retire.members') }}
122
+ </span>
123
+ <span class="text-muted text-xs tabular-nums">
124
+ {{ memberCap(preparation.members.from) }} →
125
+ <b class="text-default">
126
+ {{ memberCap(preparation.members.to) }}
127
+ </b>
128
+ </span>
129
+ <small
130
+ v-if="preparation.members.above > 0"
131
+ class="text-warning w-full pl-6 text-xs"
132
+ >
133
+ {{
134
+ $t(
135
+ 'saas.catalog.retire.above_cap',
136
+ {
137
+ count: preparation.members.above,
138
+ cap: preparation.members.to,
139
+ },
140
+ preparation.members.above,
141
+ )
142
+ }}
143
+ </small>
144
+ </li>
145
+ <li
146
+ v-if="preparation.permissions.length > 0"
147
+ class="flex items-center gap-2 px-4 py-2"
148
+ >
149
+ <UIcon name="i-ph-key" class="text-info size-4 shrink-0" />
150
+ <span class="flex-1">
151
+ {{
152
+ $t('saas.catalog.retire.permissions_changed', {
153
+ added: preparation.permissions.filter(
154
+ (row) => row.kind === 'gained',
155
+ ).length,
156
+ removed: preparation.permissions.filter(
157
+ (row) => row.kind === 'lost',
158
+ ).length,
159
+ })
160
+ }}
161
+ </span>
162
+ </li>
163
+ <li
164
+ v-if="unchanged.length > 0"
165
+ class="text-muted flex items-center gap-2 px-4 py-2"
166
+ >
167
+ <UIcon :name="KIND_ICONS.same" class="size-4 shrink-0" />
168
+ <span class="flex-1">
169
+ {{
170
+ $t('saas.catalog.retire.unchanged', {
171
+ names: unchanged.join(', '),
172
+ })
173
+ }}
174
+ </span>
175
+ </li>
176
+ </ul>
177
+ </DmsCard>
178
+ </template>
@@ -11,9 +11,8 @@ interface OtherWorkspacesProps {
11
11
  defineProps<OtherWorkspacesProps>()
12
12
 
13
13
  const { t } = useI18n()
14
- const toast = useToast()
15
14
  const { statusView } = useSaasStatus()
16
- const { resolveApiError } = useApiErrorMessage()
15
+ const { presentError } = useApiErrorPresenter()
17
16
 
18
17
  const switchingTo = ref<string | null>(null)
19
18
 
@@ -29,15 +28,9 @@ async function open(workspace: OtherWorkspace): Promise<void> {
29
28
  try {
30
29
  await useTenantSwitch(workspace._id, HOME_PATH)
31
30
  } catch (error) {
32
- toast.add({
33
- color: 'error',
34
- title: t('saas.public.suspended.others.switch_failed', {
35
- name: workspace.name,
36
- }),
37
- description: resolveApiError(
38
- error,
39
- 'saas.public.suspended.others.switch_failed_hint',
40
- ),
31
+ presentError(error, {
32
+ fallbackKey: 'saas.public.suspended.others.switch_failed',
33
+ params: { name: workspace.name },
41
34
  })
42
35
  switchingTo.value = null
43
36
  }
@@ -0,0 +1,2 @@
1
+ /** The message a registration screen shows when what it loads fails. */
2
+ export const REGISTRATION_LOAD_ERROR_KEY = 'saas.public.register.error.load'
@@ -2,7 +2,6 @@
2
2
  import { computed, onMounted, ref } from 'vue'
3
3
  import FormFieldRow from '../components/FormFieldRow.vue'
4
4
  import FormRows from '../components/FormRows.vue'
5
- import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
6
5
  import { formatMinorUnits } from '../../composables/useMoneyFormat'
7
6
  import { PLAN_UNLIMITED } from '../plan-catalog'
8
7
  import { planPriceLabel } from './planPrice'
@@ -21,7 +20,7 @@ const D = 'saas.workspace_detail.complimentary'
21
20
  const { $authFetch } = useAuthFetch()
22
21
  const { t, locale } = useI18n()
23
22
  const toast = useToast()
24
- const { resolveApiError } = useApiErrorMessage()
23
+ const { resolveError } = useApiErrorPresenter()
25
24
 
26
25
  const impact = ref<ComplimentaryImpact | null>(null)
27
26
  const loadError = ref<string | null>(null)
@@ -59,7 +58,8 @@ const fitNote = computed(() => {
59
58
  const plan = selectedPlan.value
60
59
  const seats = impact.value?.seats ?? 0
61
60
  if (!plan) return ''
62
- if (plan.maxMembers === PLAN_UNLIMITED) return t(`${D}.fits_unlimited`, { seats }, seats)
61
+ if (plan.maxMembers === PLAN_UNLIMITED)
62
+ return t(`${D}.fits_unlimited`, { seats }, seats)
63
63
  const key = plan.fits ? 'fits' : 'exceeds'
64
64
  return t(`${D}.${key}`, { seats, max: plan.maxMembers }, seats)
65
65
  })
@@ -95,7 +95,8 @@ async function load(): Promise<void> {
95
95
  planId.value = impact.value.currentPlanId ?? impact.value.plans[0]?.id
96
96
  freeUntil.value = impact.value.freeUntil?.slice(0, 10) ?? ''
97
97
  } catch (error) {
98
- loadError.value = resolveApiError(error, `${D}.load_error`)
98
+ loadError.value =
99
+ resolveError(error, { fallbackKey: `${D}.load_error` })?.message ?? ''
99
100
  }
100
101
  }
101
102
 
@@ -122,7 +123,8 @@ async function submit(): Promise<void> {
122
123
  })
123
124
  emit('done')
124
125
  } catch (error) {
125
- submitError.value = resolveApiError(error, `${D}.error`)
126
+ submitError.value =
127
+ resolveError(error, { fallbackKey: `${D}.error` })?.message ?? ''
126
128
  } finally {
127
129
  isSubmitting.value = false
128
130
  }
@@ -2,7 +2,6 @@
2
2
  import { computed, onMounted, ref } from 'vue'
3
3
  import FormFieldRow from '../components/FormFieldRow.vue'
4
4
  import FormRows from '../components/FormRows.vue'
5
- import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
6
5
  import {
7
6
  formatMinorUnits,
8
7
  fromMinorUnits,
@@ -29,7 +28,7 @@ const REASON_MAX_LENGTH = 500
29
28
  const { $authFetch } = useAuthFetch()
30
29
  const { t, locale } = useI18n()
31
30
  const toast = useToast()
32
- const { resolveApiError } = useApiErrorMessage()
31
+ const { resolveError } = useApiErrorPresenter()
33
32
 
34
33
  const options = ref<OperatorOptions | null>(null)
35
34
  const loadError = ref<string | null>(null)
@@ -82,7 +81,8 @@ async function load(): Promise<void> {
82
81
  try {
83
82
  options.value = await optionsRead.read()
84
83
  } catch (error) {
85
- loadError.value = resolveApiError(error, `${D}.load_error`)
84
+ loadError.value =
85
+ resolveError(error, { fallbackKey: `${D}.load_error` })?.message ?? ''
86
86
  }
87
87
  }
88
88
 
@@ -110,7 +110,8 @@ async function submit(): Promise<void> {
110
110
  })
111
111
  emit('done')
112
112
  } catch (error) {
113
- submitError.value = resolveApiError(error, `${D}.error`)
113
+ submitError.value =
114
+ resolveError(error, { fallbackKey: `${D}.error` })?.message ?? ''
114
115
  } finally {
115
116
  isSubmitting.value = false
116
117
  }
@@ -2,7 +2,6 @@
2
2
  import { computed, onMounted, ref, watch } from 'vue'
3
3
  import FormFieldRow from '../components/FormFieldRow.vue'
4
4
  import FormRows from '../components/FormRows.vue'
5
- import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
6
5
  import { formatMinorUnits } from '../../composables/useMoneyFormat'
7
6
  import type { OperatorOptions, UpgradePreview } from './types'
8
7
 
@@ -19,7 +18,7 @@ const D = 'saas.workspace_detail.upgrade'
19
18
  const { $authFetch } = useAuthFetch()
20
19
  const { t, locale } = useI18n()
21
20
  const toast = useToast()
22
- const { resolveApiError } = useApiErrorMessage()
21
+ const { resolveError } = useApiErrorPresenter()
23
22
 
24
23
  const options = ref<OperatorOptions | null>(null)
25
24
  const loadError = ref<string | null>(null)
@@ -74,7 +73,8 @@ async function load(): Promise<void> {
74
73
  options.value = await optionsRead.read()
75
74
  planId.value = plans.value[0]?.id
76
75
  } catch (error) {
77
- loadError.value = resolveApiError(error, `${D}.load_error`)
76
+ loadError.value =
77
+ resolveError(error, { fallbackKey: `${D}.load_error` })?.message ?? ''
78
78
  }
79
79
  }
80
80
 
@@ -94,7 +94,8 @@ async function loadPreview(): Promise<void> {
94
94
  try {
95
95
  preview.value = await previewRead.read()
96
96
  } catch (error) {
97
- previewError.value = resolveApiError(error, `${D}.preview_error`)
97
+ previewError.value =
98
+ resolveError(error, { fallbackKey: `${D}.preview_error` })?.message ?? ''
98
99
  } finally {
99
100
  isPreviewing.value = false
100
101
  }
@@ -116,7 +117,8 @@ async function submit(): Promise<void> {
116
117
  })
117
118
  emit('done')
118
119
  } catch (error) {
119
- submitError.value = resolveApiError(error, `${D}.error`)
120
+ submitError.value =
121
+ resolveError(error, { fallbackKey: `${D}.error` })?.message ?? ''
120
122
  } finally {
121
123
  isSubmitting.value = false
122
124
  }
@@ -10,7 +10,7 @@ export interface WorkspaceOverview {
10
10
  ownerName: string | null
11
11
  ownerEmail: string | null
12
12
  ownerStatus: string
13
- joinedAt: string | null
13
+ membership: { role: 'owner' | 'member' | 'support'; joinedAt: string } | null
14
14
  stripeCustomerId: string | null
15
15
  stripeCustomerUrl: string | null
16
16
  hasStripeSubscription: boolean
@@ -1,4 +1,3 @@
1
- import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
2
1
  import { formatMinorUnits } from '../../composables/useMoneyFormat'
3
2
  import type { SuspensionImpact } from './types'
4
3
 
@@ -22,7 +21,7 @@ export function useWorkspaceActions(tenantId: string) {
22
21
  const { confirm } = useConfirm()
23
22
  const { confirmFrom } = useConfirmFrom()
24
23
  const toast = useToast()
25
- const { resolveApiError } = useApiErrorMessage()
24
+ const { presentError } = useApiErrorPresenter()
26
25
  const base = `/api/saas/workspaces/${tenantId}`
27
26
  const impactRead = useOnDemandRead<SuspensionImpact>(
28
27
  () => `${base}/suspension-impact`,
@@ -47,11 +46,7 @@ export function useWorkspaceActions(tenantId: string) {
47
46
  })
48
47
  refreshPageBlocks()
49
48
  } catch (error) {
50
- toast.add({
51
- title: resolveApiError(error, `${D}.error.prepare`),
52
- color: 'error',
53
- icon: 'i-ph-warning-circle',
54
- })
49
+ presentError(error, { fallbackKey: `${D}.error.prepare` })
55
50
  }
56
51
  }
57
52
 
@@ -6,3 +6,15 @@ export const DATA_EXPORT_PATH = '/settings/workspace/data-export'
6
6
  export const GENERAL_PATH = '/settings/workspace/general'
7
7
  /** Where a workspace switch lands: the previous page belonged to the old tenant. */
8
8
  export const HOME_PATH = '/'
9
+
10
+ export function workspaceSwitchLandingPath(
11
+ metadata: unknown,
12
+ ): string | undefined {
13
+ return typeof metadata === 'object' &&
14
+ metadata !== null &&
15
+ Object.hasOwn(metadata, 'workspaceScoped') &&
16
+ 'workspaceScoped' in metadata &&
17
+ metadata.workspaceScoped === true
18
+ ? HOME_PATH
19
+ : undefined
20
+ }
@@ -30,7 +30,7 @@ interface PortalSession {
30
30
  }
31
31
 
32
32
  const { $authFetch } = useAuthFetch()
33
- const { resolveApiError } = useApiErrorMessage()
33
+ const { resolveError } = useApiErrorPresenter()
34
34
  const billingStatus = useBillingStatus({ server: !props.isDeferred }).data
35
35
  const data = props.isDeferred ? useMountedData(billingStatus) : billingStatus
36
36
  const isLoading = ref(false)
@@ -52,7 +52,9 @@ async function openCustomerPortal(): Promise<void> {
52
52
  })
53
53
  if (typeof window !== 'undefined') window.location.href = result.url
54
54
  } catch (error) {
55
- failure.value = resolveApiError(error, 'saas.tenant_billing.portal.error')
55
+ failure.value =
56
+ resolveError(error, { fallbackKey: 'saas.tenant_billing.portal.error' })
57
+ ?.message ?? ''
56
58
  isLoading.value = false
57
59
  }
58
60
  }
@@ -16,10 +16,9 @@ const TIME_FORMAT: Intl.DateTimeFormatOptions = {
16
16
 
17
17
  const { t, locale } = useI18n()
18
18
  const { user } = useCurrentUser()
19
- const { resolveApiError } = useApiErrorMessage()
19
+ const { presentError } = useApiErrorPresenter()
20
20
  const route = useDmsRoute()
21
21
  const router = useDmsRouter()
22
- const toast = useToast()
23
22
  const { state, running, load, start, download } = useExportHistory()
24
23
 
25
24
  /** The export this visit watched finish, shown until the page is left. */
@@ -34,7 +33,11 @@ const runningStatus = useApiData<ExportJobStatus>(
34
33
  running.value
35
34
  ? `${EXPORT_STATUS_ENDPOINT}/${encodeURIComponent(running.value.jobId)}`
36
35
  : null,
37
- { server: false, refreshInterval: POLL_INTERVAL_MS, refreshOnPageRefresh: false },
36
+ {
37
+ server: false,
38
+ refreshInterval: POLL_INTERVAL_MS,
39
+ refreshOnPageRefresh: false,
40
+ },
38
41
  )
39
42
 
40
43
  const email = computed(() => user.value?.email ?? '')
@@ -70,25 +73,21 @@ function errorStatus(error: unknown): number | undefined {
70
73
  return typeof status === 'number' ? status : undefined
71
74
  }
72
75
 
73
- function notifyError(error: unknown, fallbackKey: string): void {
74
- toast.add({
75
- title: resolveApiError(error, fallbackKey),
76
- color: 'error',
77
- icon: 'i-ph-warning-circle',
78
- })
79
- }
80
-
81
76
  async function requestExport(): Promise<void> {
82
77
  finished.value = null
83
78
  expiredLinkJobId.value = null
84
- await start().catch((error) => notifyError(error, `${KEYS}.error.start`))
79
+ await start().catch((error) =>
80
+ presentError(error, { fallbackKey: `${KEYS}.error.start` }),
81
+ )
85
82
  }
86
83
 
87
84
  async function downloadFinished(): Promise<void> {
88
85
  if (!finished.value || isDownloading.value) return
89
86
  isDownloading.value = true
90
87
  await download(finished.value.jobId, finished.value)
91
- .catch((error) => notifyError(error, `${KEYS}.error.download`))
88
+ .catch((error) =>
89
+ presentError(error, { fallbackKey: `${KEYS}.error.download` }),
90
+ )
92
91
  .finally(() => {
93
92
  isDownloading.value = false
94
93
  })
@@ -127,7 +126,8 @@ async function consumeDeliveredLink(): Promise<void> {
127
126
  await clearDeliveredLink()
128
127
  } catch (error) {
129
128
  const isGone = GONE_STATUSES.has(errorStatus(error) ?? 0)
130
- if (!isGone) return notifyError(error, `${KEYS}.error.download`)
129
+ if (!isGone)
130
+ return presentError(error, { fallbackKey: `${KEYS}.error.download` })
131
131
  expiredLinkJobId.value = jobId
132
132
  await clearDeliveredLink()
133
133
  }