@byline/host-tanstack-start 3.21.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/admin-shell/admin-activity/list.js +15 -5
  2. package/dist/admin-shell/admin-roles/delete.js +2 -1
  3. package/dist/admin-shell/admin-roles/list.js +2 -1
  4. package/dist/admin-shell/admin-users/delete.js +2 -1
  5. package/dist/admin-shell/admin-users/list.js +4 -7
  6. package/dist/admin-shell/chrome/admin-app-bar.js +2 -1
  7. package/dist/admin-shell/chrome/admin-menu-drawer.js +9 -8
  8. package/dist/admin-shell/chrome/admin-menu-provider.js +2 -1
  9. package/dist/admin-shell/chrome/dashboard.js +4 -3
  10. package/dist/admin-shell/chrome/sign-in-page.d.ts +2 -2
  11. package/dist/admin-shell/chrome/sign-in-page.js +2 -2
  12. package/dist/admin-shell/collections/create.js +4 -3
  13. package/dist/admin-shell/collections/document-history.js +6 -1
  14. package/dist/admin-shell/collections/edit.js +18 -14
  15. package/dist/admin-shell/collections/history.js +5 -4
  16. package/dist/admin-shell/collections/list.js +8 -7
  17. package/dist/admin-shell/collections/restore-version-modal.js +2 -1
  18. package/dist/admin-shell/collections/tree-list.js +53 -17
  19. package/dist/admin-shell/collections/view-menu.js +9 -8
  20. package/dist/i18n/resolve-locale.js +1 -1
  21. package/dist/index.d.ts +5 -6
  22. package/dist/integrations/abilities.js +8 -7
  23. package/dist/integrations/host-bridge.d.ts +13 -0
  24. package/dist/integrations/host-bridge.js +22 -0
  25. package/dist/integrations/serve-uploads.d.ts +1 -0
  26. package/dist/integrations/serve-uploads.js +1 -0
  27. package/dist/integrations/start-errors.js +2 -1
  28. package/dist/routes/admin-path.d.ts +22 -0
  29. package/dist/routes/admin-path.js +35 -0
  30. package/dist/routes/create-admin-account-route.js +3 -2
  31. package/dist/routes/create-admin-activity-route.js +3 -2
  32. package/dist/routes/create-admin-dashboard-route.js +2 -1
  33. package/dist/routes/create-admin-layout-route.d.ts +1 -1
  34. package/dist/routes/create-admin-layout-route.js +3 -1
  35. package/dist/routes/create-admin-permissions-route.js +3 -2
  36. package/dist/routes/create-admin-role-edit-route.js +4 -3
  37. package/dist/routes/create-admin-roles-list-route.js +3 -2
  38. package/dist/routes/create-admin-user-edit-route.js +4 -3
  39. package/dist/routes/create-admin-users-list-route.js +3 -2
  40. package/dist/routes/create-collection-api-route.js +5 -4
  41. package/dist/routes/create-collection-create-route.js +4 -3
  42. package/dist/routes/create-collection-edit-route.js +4 -3
  43. package/dist/routes/create-collection-history-route.js +5 -4
  44. package/dist/routes/create-collection-list-route.js +3 -2
  45. package/dist/routes/create-sign-in-route.js +3 -2
  46. package/dist/routes/index.d.ts +3 -0
  47. package/dist/routes/index.js +2 -0
  48. package/dist/routes/sign-in-path.d.ts +13 -0
  49. package/dist/routes/sign-in-path.js +19 -0
  50. package/dist/server-fns/admin-account/change-password.js +1 -1
  51. package/dist/server-fns/admin-account/get.js +1 -1
  52. package/dist/server-fns/admin-account/update.js +1 -1
  53. package/dist/server-fns/admin-activity/get.js +1 -1
  54. package/dist/server-fns/admin-permissions/get-role-abilities.js +1 -1
  55. package/dist/server-fns/admin-permissions/list-registered.js +1 -1
  56. package/dist/server-fns/admin-permissions/set-role-abilities.js +1 -1
  57. package/dist/server-fns/admin-permissions/who-has.js +1 -1
  58. package/dist/server-fns/admin-roles/create.js +1 -1
  59. package/dist/server-fns/admin-roles/delete.js +1 -1
  60. package/dist/server-fns/admin-roles/get.js +1 -1
  61. package/dist/server-fns/admin-roles/list.js +1 -1
  62. package/dist/server-fns/admin-roles/reorder.js +1 -1
  63. package/dist/server-fns/admin-roles/update.js +1 -1
  64. package/dist/server-fns/admin-users/create.js +1 -1
  65. package/dist/server-fns/admin-users/delete.js +1 -1
  66. package/dist/server-fns/admin-users/disable.js +1 -1
  67. package/dist/server-fns/admin-users/enable.js +1 -1
  68. package/dist/server-fns/admin-users/get-user-roles.js +1 -1
  69. package/dist/server-fns/admin-users/get.js +1 -1
  70. package/dist/server-fns/admin-users/list.js +1 -1
  71. package/dist/server-fns/admin-users/set-password.js +1 -1
  72. package/dist/server-fns/admin-users/set-user-roles.js +1 -1
  73. package/dist/server-fns/admin-users/update.js +1 -1
  74. package/dist/server-fns/ai/execute.js +1 -1
  75. package/dist/server-fns/auth/current-user.js +1 -1
  76. package/dist/server-fns/auth/sign-in.js +1 -1
  77. package/dist/server-fns/auth/sign-out.js +1 -2
  78. package/dist/server-fns/collections/audit.js +1 -1
  79. package/dist/server-fns/collections/copy-to-locale.js +1 -1
  80. package/dist/server-fns/collections/create.js +1 -1
  81. package/dist/server-fns/collections/delete-locale.js +1 -1
  82. package/dist/server-fns/collections/delete-outcome.d.ts +30 -0
  83. package/dist/server-fns/collections/delete-outcome.js +34 -0
  84. package/dist/server-fns/collections/delete.d.ts +1 -4
  85. package/dist/server-fns/collections/delete.js +3 -5
  86. package/dist/server-fns/collections/duplicate.js +1 -1
  87. package/dist/server-fns/collections/get.js +1 -1
  88. package/dist/server-fns/collections/history.js +1 -1
  89. package/dist/server-fns/collections/index.d.ts +1 -0
  90. package/dist/server-fns/collections/index.js +1 -0
  91. package/dist/server-fns/collections/list.js +1 -1
  92. package/dist/server-fns/collections/reindex.js +1 -1
  93. package/dist/server-fns/collections/reorder.js +1 -1
  94. package/dist/server-fns/collections/restore-version.js +1 -1
  95. package/dist/server-fns/collections/stats.js +1 -1
  96. package/dist/server-fns/collections/status.js +1 -1
  97. package/dist/server-fns/collections/tree-mutation.d.ts +46 -0
  98. package/dist/server-fns/collections/tree-mutation.js +109 -0
  99. package/dist/server-fns/collections/tree-read.d.ts +6 -0
  100. package/dist/server-fns/collections/tree-read.js +15 -0
  101. package/dist/server-fns/collections/tree.d.ts +5 -4
  102. package/dist/server-fns/collections/tree.js +16 -13
  103. package/dist/server-fns/collections/update.js +3 -2
  104. package/dist/server-fns/collections/upload.js +1 -1
  105. package/dist/server-fns/i18n/set-locale.js +1 -1
  106. package/dist/server-fns/preview/disable.js +1 -1
  107. package/dist/server-fns/preview/enable.js +1 -2
  108. package/dist/server-fns/preview/state.js +1 -1
  109. package/dist/vite/client-hook-boundary.d.ts +19 -0
  110. package/dist/vite/client-hook-boundary.js +20 -0
  111. package/dist/{integrations/byline-public-client.d.ts → vite/index.d.ts} +1 -2
  112. package/dist/vite/index.js +1 -0
  113. package/package.json +15 -14
  114. package/src/admin-shell/admin-activity/list.tsx +13 -3
  115. package/src/admin-shell/admin-roles/delete.tsx +2 -1
  116. package/src/admin-shell/admin-roles/list.tsx +2 -1
  117. package/src/admin-shell/admin-users/delete.tsx +3 -2
  118. package/src/admin-shell/admin-users/list.tsx +9 -8
  119. package/src/admin-shell/chrome/admin-app-bar.tsx +2 -1
  120. package/src/admin-shell/chrome/admin-menu-drawer.tsx +13 -8
  121. package/src/admin-shell/chrome/admin-menu-provider.tsx +2 -1
  122. package/src/admin-shell/chrome/dashboard.tsx +4 -3
  123. package/src/admin-shell/chrome/sign-in-page.tsx +3 -3
  124. package/src/admin-shell/collections/create.tsx +4 -3
  125. package/src/admin-shell/collections/document-history.tsx +5 -0
  126. package/src/admin-shell/collections/edit.tsx +20 -13
  127. package/src/admin-shell/collections/history.tsx +6 -5
  128. package/src/admin-shell/collections/list.tsx +8 -7
  129. package/src/admin-shell/collections/restore-version-modal.tsx +2 -1
  130. package/src/admin-shell/collections/tree-list.tsx +78 -22
  131. package/src/admin-shell/collections/view-menu.tsx +9 -8
  132. package/src/i18n/resolve-locale.ts +1 -1
  133. package/src/index.ts +5 -6
  134. package/src/integrations/abilities.tsx +14 -4
  135. package/src/integrations/host-bridge.ts +56 -0
  136. package/src/integrations/serve-uploads.ts +6 -0
  137. package/src/integrations/start-errors.test.node.ts +22 -0
  138. package/src/integrations/start-errors.ts +1 -0
  139. package/src/routes/admin-path.test.node.ts +129 -0
  140. package/src/routes/admin-path.ts +66 -0
  141. package/src/routes/auth-routes.test.node.ts +39 -0
  142. package/src/routes/create-admin-account-route.tsx +3 -2
  143. package/src/routes/create-admin-activity-route.tsx +3 -2
  144. package/src/routes/create-admin-dashboard-route.tsx +2 -1
  145. package/src/routes/create-admin-layout-route.tsx +4 -4
  146. package/src/routes/create-admin-permissions-route.tsx +3 -2
  147. package/src/routes/create-admin-role-edit-route.tsx +7 -3
  148. package/src/routes/create-admin-roles-list-route.tsx +3 -2
  149. package/src/routes/create-admin-user-edit-route.tsx +7 -3
  150. package/src/routes/create-admin-users-list-route.tsx +3 -2
  151. package/src/routes/create-collection-api-route.tsx +8 -4
  152. package/src/routes/create-collection-create-route.tsx +7 -3
  153. package/src/routes/create-collection-edit-route.tsx +7 -3
  154. package/src/routes/create-collection-history-route.tsx +8 -4
  155. package/src/routes/create-collection-list-route.tsx +3 -2
  156. package/src/routes/create-sign-in-route.tsx +9 -3
  157. package/src/routes/index.ts +11 -0
  158. package/src/routes/sign-in-path.test.node.ts +79 -0
  159. package/src/routes/sign-in-path.ts +36 -0
  160. package/src/server-fns/admin-account/change-password.ts +1 -1
  161. package/src/server-fns/admin-account/get.ts +1 -1
  162. package/src/server-fns/admin-account/update.ts +1 -1
  163. package/src/server-fns/admin-activity/get.ts +1 -1
  164. package/src/server-fns/admin-permissions/get-role-abilities.ts +1 -1
  165. package/src/server-fns/admin-permissions/list-registered.ts +1 -1
  166. package/src/server-fns/admin-permissions/set-role-abilities.ts +1 -1
  167. package/src/server-fns/admin-permissions/who-has.ts +1 -1
  168. package/src/server-fns/admin-roles/create.ts +1 -1
  169. package/src/server-fns/admin-roles/delete.ts +1 -1
  170. package/src/server-fns/admin-roles/get.ts +1 -1
  171. package/src/server-fns/admin-roles/list.ts +1 -1
  172. package/src/server-fns/admin-roles/reorder.ts +1 -1
  173. package/src/server-fns/admin-roles/update.ts +1 -1
  174. package/src/server-fns/admin-users/create.ts +1 -1
  175. package/src/server-fns/admin-users/delete.ts +1 -1
  176. package/src/server-fns/admin-users/disable.ts +1 -1
  177. package/src/server-fns/admin-users/enable.ts +1 -1
  178. package/src/server-fns/admin-users/get-user-roles.ts +1 -1
  179. package/src/server-fns/admin-users/get.ts +1 -1
  180. package/src/server-fns/admin-users/list.ts +1 -1
  181. package/src/server-fns/admin-users/set-password.ts +1 -1
  182. package/src/server-fns/admin-users/set-user-roles.ts +1 -1
  183. package/src/server-fns/admin-users/update.ts +1 -1
  184. package/src/server-fns/ai/execute.ts +1 -2
  185. package/src/server-fns/auth/current-user.ts +1 -1
  186. package/src/server-fns/auth/sign-in.ts +1 -1
  187. package/src/server-fns/auth/sign-out.ts +5 -3
  188. package/src/server-fns/collections/audit.ts +1 -1
  189. package/src/server-fns/collections/copy-to-locale.ts +1 -1
  190. package/src/server-fns/collections/create.ts +1 -1
  191. package/src/server-fns/collections/delete-locale.ts +1 -1
  192. package/src/server-fns/collections/delete-outcome.test.node.ts +72 -0
  193. package/src/server-fns/collections/delete-outcome.ts +80 -0
  194. package/src/server-fns/collections/delete.ts +3 -2
  195. package/src/server-fns/collections/duplicate.ts +1 -1
  196. package/src/server-fns/collections/get.ts +3 -1
  197. package/src/server-fns/collections/history.ts +1 -1
  198. package/src/server-fns/collections/index.ts +1 -0
  199. package/src/server-fns/collections/list.ts +1 -1
  200. package/src/server-fns/collections/reindex.ts +1 -1
  201. package/src/server-fns/collections/reorder.ts +1 -1
  202. package/src/server-fns/collections/restore-version.ts +1 -1
  203. package/src/server-fns/collections/stats.ts +2 -1
  204. package/src/server-fns/collections/status.ts +1 -1
  205. package/src/server-fns/collections/tree-mutation.test.node.ts +225 -0
  206. package/src/server-fns/collections/tree-mutation.ts +165 -0
  207. package/src/server-fns/collections/tree-read.test.node.ts +46 -0
  208. package/src/server-fns/collections/tree-read.ts +26 -0
  209. package/src/server-fns/collections/tree.ts +27 -11
  210. package/src/server-fns/collections/update.ts +4 -1
  211. package/src/server-fns/collections/upload.ts +1 -1
  212. package/src/server-fns/i18n/set-locale.ts +1 -1
  213. package/src/server-fns/preview/disable.ts +1 -1
  214. package/src/server-fns/preview/enable.ts +1 -2
  215. package/src/server-fns/preview/state.ts +1 -1
  216. package/src/vite/client-hook-boundary.test.node.ts +50 -0
  217. package/src/vite/client-hook-boundary.ts +45 -0
  218. package/src/vite/index.ts +9 -0
  219. package/dist/auth/auth-context.d.ts +0 -37
  220. package/dist/auth/auth-context.js +0 -57
  221. package/dist/auth/auth-cookies.d.ts +0 -34
  222. package/dist/auth/auth-cookies.js +0 -46
  223. package/dist/auth/preview-cookies.d.ts +0 -19
  224. package/dist/auth/preview-cookies.js +0 -26
  225. package/dist/integrations/byline-client.d.ts +0 -24
  226. package/dist/integrations/byline-client.js +0 -25
  227. package/dist/integrations/byline-public-client.js +0 -15
  228. package/dist/integrations/byline-viewer-client.d.ts +0 -20
  229. package/dist/integrations/byline-viewer-client.js +0 -39
  230. package/src/auth/auth-context.test.node.ts +0 -215
  231. package/src/auth/auth-context.ts +0 -124
  232. package/src/auth/auth-cookies.ts +0 -113
  233. package/src/auth/preview-cookies.ts +0 -73
  234. package/src/integrations/byline-client.ts +0 -66
  235. package/src/integrations/byline-public-client.ts +0 -53
  236. package/src/integrations/byline-viewer-client.ts +0 -99
@@ -6,6 +6,7 @@ import { RoleContainer } from "../admin-shell/admin-roles/container.js";
6
6
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
7
7
  import { getRoleAbilities, listRegisteredAbilities } from "../server-fns/admin-permissions/index.js";
8
8
  import { getAdminRole } from "../server-fns/admin-roles/index.js";
9
+ import { getAdminRoutePath } from "./admin-path.js";
9
10
  function createAdminRoleEditRoute(path) {
10
11
  const Route = createFileRoute(path)({
11
12
  loader: async ({ params })=>{
@@ -42,15 +43,15 @@ function createAdminRoleEditRoute(path) {
42
43
  breadcrumbs: [
43
44
  {
44
45
  label: t('chrome.menu.dashboard'),
45
- href: '/admin'
46
+ href: getAdminRoutePath()
46
47
  },
47
48
  {
48
49
  label: t('chrome.menu.adminRoles'),
49
- href: '/admin/roles'
50
+ href: getAdminRoutePath('roles')
50
51
  },
51
52
  {
52
53
  label: t('adminRoles.breadcrumbDetail'),
53
- href: `/admin/roles/${role.id}`
54
+ href: getAdminRoutePath('roles', role.id)
54
55
  }
55
56
  ]
56
57
  }),
@@ -4,6 +4,7 @@ import { useTranslation } from "@byline/i18n/react";
4
4
  import { AdminRolesListView } from "../admin-shell/admin-roles/list.js";
5
5
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
6
6
  import { listAdminRoles } from "../server-fns/admin-roles/index.js";
7
+ import { getAdminRoutePath } from "./admin-path.js";
7
8
  function createAdminRolesListRoute(path) {
8
9
  const Route = createFileRoute(path)({
9
10
  loader: async ()=>{
@@ -21,11 +22,11 @@ function createAdminRolesListRoute(path) {
21
22
  breadcrumbs: [
22
23
  {
23
24
  label: t('chrome.menu.dashboard'),
24
- href: '/admin'
25
+ href: getAdminRoutePath()
25
26
  },
26
27
  {
27
28
  label: t('chrome.menu.adminRoles'),
28
- href: '/admin/roles'
29
+ href: getAdminRoutePath('roles')
29
30
  }
30
31
  ]
31
32
  }),
@@ -6,6 +6,7 @@ import { AccountContainer } from "../admin-shell/admin-users/container.js";
6
6
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
7
7
  import { listAdminRoles } from "../server-fns/admin-roles/index.js";
8
8
  import { getAdminUser, getUserRoles } from "../server-fns/admin-users/index.js";
9
+ import { getAdminRoutePath } from "./admin-path.js";
9
10
  function displayNameFor(user) {
10
11
  const parts = [
11
12
  user.given_name,
@@ -49,15 +50,15 @@ function createAdminUserEditRoute(path) {
49
50
  breadcrumbs: [
50
51
  {
51
52
  label: t('chrome.menu.dashboard'),
52
- href: '/admin'
53
+ href: getAdminRoutePath()
53
54
  },
54
55
  {
55
56
  label: t('chrome.menu.adminUsers'),
56
- href: '/admin/users'
57
+ href: getAdminRoutePath('users')
57
58
  },
58
59
  {
59
60
  label: t('adminUsers.breadcrumbDetail'),
60
- href: `/admin/users/${user.id}`
61
+ href: getAdminRoutePath('users', user.id)
61
62
  }
62
63
  ]
63
64
  }),
@@ -5,6 +5,7 @@ import { z } from "zod";
5
5
  import { AdminUsersListView } from "../admin-shell/admin-users/list.js";
6
6
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
7
7
  import { listAdminUsers } from "../server-fns/admin-users/index.js";
8
+ import { getAdminRoutePath } from "./admin-path.js";
8
9
  const orderSchema = z["enum"]([
9
10
  'given_name',
10
11
  'family_name',
@@ -53,11 +54,11 @@ function createAdminUsersListRoute(path) {
53
54
  breadcrumbs: [
54
55
  {
55
56
  label: t('chrome.menu.dashboard'),
56
- href: '/admin'
57
+ href: getAdminRoutePath()
57
58
  },
58
59
  {
59
60
  label: t('chrome.menu.adminUsers'),
60
- href: '/admin/users'
61
+ href: getAdminRoutePath('users')
61
62
  }
62
63
  ]
63
64
  }),
@@ -6,6 +6,7 @@ import { z } from "zod";
6
6
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
7
7
  import { ApiView } from "../admin-shell/collections/api.js";
8
8
  import { getCollectionDocument } from "../server-fns/collections/index.js";
9
+ import { getAdminRoutePath } from "./admin-path.js";
9
10
  import { getContentLocaleRouteConfig } from "./get-content-locale-route-config.js";
10
11
  const searchSchema = z.object({
11
12
  locale: z.string().optional(),
@@ -43,19 +44,19 @@ function createCollectionApiRoute(path) {
43
44
  breadcrumbs: [
44
45
  {
45
46
  label: t('chrome.menu.dashboard'),
46
- href: "/admin"
47
+ href: getAdminRoutePath()
47
48
  },
48
49
  {
49
50
  label: collectionDef.labels.plural,
50
- href: `/admin/collections/${collection}`
51
+ href: getAdminRoutePath('collections', collection)
51
52
  },
52
53
  {
53
54
  label: t('common.actions.edit'),
54
- href: `/admin/collections/${collection}/${id}`
55
+ href: getAdminRoutePath('collections', collection, id)
55
56
  },
56
57
  {
57
58
  label: t('collections.viewMenu.apiButton'),
58
- href: `/admin/collections/${collection}/${id}/api`
59
+ href: getAdminRoutePath('collections', collection, id, 'api')
59
60
  }
60
61
  ]
61
62
  }),
@@ -4,6 +4,7 @@ import { buildInitialDataFromFields, getCollectionAdminConfig, getCollectionDefi
4
4
  import { useTranslation } from "@byline/i18n/react";
5
5
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
6
6
  import { CreateView } from "../admin-shell/collections/create.js";
7
+ import { getAdminRoutePath } from "./admin-path.js";
7
8
  function createCollectionCreateRoute(path) {
8
9
  const Route = createFileRoute(path)({
9
10
  loader: async ({ params })=>{
@@ -29,15 +30,15 @@ function createCollectionCreateRoute(path) {
29
30
  breadcrumbs: [
30
31
  {
31
32
  label: t('chrome.menu.dashboard'),
32
- href: '/admin'
33
+ href: getAdminRoutePath()
33
34
  },
34
35
  {
35
36
  label: collectionDef.labels.plural,
36
- href: `/admin/collections/${collection}`
37
+ href: getAdminRoutePath('collections', collection)
37
38
  },
38
39
  {
39
40
  label: t('collections.breadcrumbs.create'),
40
- href: `/admin/collections/${collection}/create`
41
+ href: getAdminRoutePath('collections', collection, 'create')
41
42
  }
42
43
  ]
43
44
  }),
@@ -9,6 +9,7 @@ import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs
9
9
  import { useNavigate } from "../admin-shell/chrome/loose-router.js";
10
10
  import { EditView } from "../admin-shell/collections/edit.js";
11
11
  import { getCollectionDocument } from "../server-fns/collections/index.js";
12
+ import { getAdminRoutePath } from "./admin-path.js";
12
13
  import { getContentLocaleRouteConfig } from "./get-content-locale-route-config.js";
13
14
  const searchSchema = z.object({
14
15
  locale: z.string().optional(),
@@ -86,15 +87,15 @@ function createCollectionEditRoute(path) {
86
87
  breadcrumbs: [
87
88
  {
88
89
  label: t('chrome.menu.dashboard'),
89
- href: "/admin"
90
+ href: getAdminRoutePath()
90
91
  },
91
92
  {
92
93
  label: collectionDef.labels.plural,
93
- href: `/admin/collections/${collection}`
94
+ href: getAdminRoutePath('collections', collection)
94
95
  },
95
96
  {
96
97
  label: t('common.actions.edit'),
97
- href: `/admin/collections/${collection}/${id}`
98
+ href: getAdminRoutePath('collections', collection, id)
98
99
  }
99
100
  ]
100
101
  }),
@@ -6,6 +6,7 @@ import { z } from "zod";
6
6
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
7
7
  import { HistoryView } from "../admin-shell/collections/history.js";
8
8
  import { getCollectionDocument, getCollectionDocumentAuditLog, getCollectionDocumentHistory } from "../server-fns/collections/index.js";
9
+ import { getAdminRoutePath } from "./admin-path.js";
9
10
  import { getContentLocaleRouteConfig } from "./get-content-locale-route-config.js";
10
11
  const searchSchema = z.object({
11
12
  page: z.coerce.number().min(1).optional(),
@@ -80,19 +81,19 @@ function createCollectionHistoryRoute(path) {
80
81
  breadcrumbs: [
81
82
  {
82
83
  label: t('chrome.menu.dashboard'),
83
- href: "/admin"
84
+ href: getAdminRoutePath()
84
85
  },
85
86
  {
86
87
  label: collectionDef.labels.plural,
87
- href: `/admin/collections/${collection}`
88
+ href: getAdminRoutePath('collections', collection)
88
89
  },
89
90
  {
90
91
  label: t('common.actions.edit'),
91
- href: `/admin/collections/${collection}/${Route.useParams().id}`
92
+ href: getAdminRoutePath('collections', collection, Route.useParams().id)
92
93
  },
93
94
  {
94
95
  label: t('collections.breadcrumbs.history'),
95
- href: `/admin/collections/${collection}/${Route.useParams().id}/history`
96
+ href: getAdminRoutePath('collections', collection, Route.useParams().id, 'history')
96
97
  }
97
98
  ]
98
99
  }),
@@ -11,6 +11,7 @@ import { useNavigate } from "../admin-shell/chrome/loose-router.js";
11
11
  import { ListView } from "../admin-shell/collections/list.js";
12
12
  import { TreeListView } from "../admin-shell/collections/tree-list.js";
13
13
  import { getCollectionDocuments, getCollectionTree, placeTreeNode, reorderCollectionDocument } from "../server-fns/collections/index.js";
14
+ import { getAdminRoutePath } from "./admin-path.js";
14
15
  const searchSchema = z.object({
15
16
  page: z.coerce.number().min(1).optional(),
16
17
  page_size: z.coerce.number().max(100).optional(),
@@ -118,11 +119,11 @@ function createCollectionListRoute(path) {
118
119
  breadcrumbs: [
119
120
  {
120
121
  label: t('chrome.menu.dashboard'),
121
- href: "/admin"
122
+ href: getAdminRoutePath()
122
123
  },
123
124
  {
124
125
  label: data.included.collection.labels.plural,
125
- href: `/admin/collections/${collection}`
126
+ href: getAdminRoutePath('collections', collection)
126
127
  }
127
128
  ]
128
129
  }),
@@ -2,10 +2,11 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { createFileRoute } from "@tanstack/react-router";
3
3
  import { SignInPage } from "../admin-shell/chrome/sign-in-page.js";
4
4
  import { getActiveLocaleFn } from "../server-fns/i18n/index.js";
5
+ import { resolveAdminCallbackPath, resolveAdminSignInRedirect } from "./admin-path.js";
5
6
  function createSignInRoute(path) {
6
7
  const Route = createFileRoute(path)({
7
8
  validateSearch: (search)=>{
8
- const callbackUrl = 'string' == typeof search.callbackUrl ? search.callbackUrl : void 0;
9
+ const callbackUrl = resolveAdminCallbackPath(search.callbackUrl);
9
10
  return {
10
11
  callbackUrl
11
12
  };
@@ -20,7 +21,7 @@ function createSignInRoute(path) {
20
21
  const { callbackUrl } = Route.useSearch();
21
22
  const { activeLocale } = Route.useRouteContext();
22
23
  return /*#__PURE__*/ jsx(SignInPage, {
23
- callbackUrl: callbackUrl,
24
+ redirectTo: resolveAdminSignInRedirect(callbackUrl),
24
25
  activeLocale: activeLocale
25
26
  });
26
27
  }
@@ -5,6 +5,8 @@
5
5
  *
6
6
  * Copyright (c) Infonomic Company Limited
7
7
  */
8
+ export { getAdminRouteId, getAdminRoutePath, isAdminRoutePathActive, isRoutePathWithin, resolveAdminCallbackPath, resolveAdminSignInRedirect, } from './admin-path.js';
9
+ export { configureSignInRoutePath, getSignInRoutePath } from './sign-in-path.js';
8
10
  /**
9
11
  * Route factories for the Byline admin UI on TanStack Start.
10
12
  *
@@ -13,6 +15,7 @@
13
15
  * `createFileRoute(path)({...})`. The host's route file collapses to:
14
16
  *
15
17
  * import { createCollectionListRoute } from '@byline/host-tanstack-start/routes'
18
+ * // Default admin mount example:
16
19
  * export const Route = createCollectionListRoute('/_byline/admin/collections/$collection/')
17
20
  *
18
21
  * Routes that need host-specific data (i18n bridge component, content
@@ -1,3 +1,5 @@
1
+ export { getAdminRouteId, getAdminRoutePath, isAdminRoutePathActive, isRoutePathWithin, resolveAdminCallbackPath, resolveAdminSignInRedirect } from "./admin-path.js";
2
+ export { configureSignInRoutePath, getSignInRoutePath } from "./sign-in-path.js";
1
3
  export { createAdminAccountRoute } from "./create-admin-account-route.js";
2
4
  export { createAdminActivityRoute } from "./create-admin-activity-route.js";
3
5
  export { createAdminDashboardRoute } from "./create-admin-dashboard-route.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+ /** Read the canonical client-safe sign-in destination. */
9
+ export declare function getSignInRoutePath(): string;
10
+ /** @deprecated Configure `routes.signIn`; retained for route-factory input validation. */
11
+ export declare function configureSignInRoutePath(legacyOverride?: string): string;
12
+ /** Defer deprecated override validation until the admin route's beforeLoad boundary. */
13
+ export declare function createSignInRoutePathResolver(legacyOverride?: string): () => string;
@@ -0,0 +1,19 @@
1
+ import { getClientConfig, resolveRoutes } from "@byline/core";
2
+ function getSignInRoutePath() {
3
+ return getClientConfig().routes.signIn;
4
+ }
5
+ function configureSignInRoutePath(legacyOverride) {
6
+ const routes = getClientConfig().routes;
7
+ const configured = routes.signIn;
8
+ if (void 0 === legacyOverride) return configured;
9
+ const normalizedOverride = resolveRoutes({
10
+ ...routes,
11
+ signIn: legacyOverride
12
+ }).signIn;
13
+ if (normalizedOverride !== configured) throw new Error(`createAdminLayoutRoute signInPath (${normalizedOverride}) must match routes.signIn (${configured})`);
14
+ return configured;
15
+ }
16
+ function createSignInRoutePathResolver(legacyOverride) {
17
+ return void 0 === legacyOverride ? getSignInRoutePath : ()=>configureSignInRoutePath(legacyOverride);
18
+ }
19
+ export { configureSignInRoutePath, createSignInRoutePathResolver, getSignInRoutePath };
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { changeAccountPasswordCommand } from "@byline/admin/admin-account";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const changeAccountPassword = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { getAccountCommand } from "@byline/admin/admin-account";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const getAccount = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { updateAccountCommand } from "@byline/admin/admin-account";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const updateAccount = createServerFn({
6
6
  method: 'POST'
@@ -1,8 +1,8 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { assertAdminActor } from "@byline/admin";
3
3
  import { ADMIN_ACTIVITY_ABILITIES } from "@byline/admin/admin-activity";
4
+ import { getAdminRequestContext } from "@byline/client/server";
4
5
  import { ERR_AUDIT_UNSUPPORTED, getLogger, getServerConfig } from "@byline/core";
5
- import { getAdminRequestContext } from "../../auth/auth-context.js";
6
6
  import { resolveActorLabels } from "../collections/actors.js";
7
7
  const getSystemActivityLog = createServerFn({
8
8
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { getRoleAbilitiesCommand } from "@byline/admin/admin-permissions";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const getRoleAbilities = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { listRegisteredAbilitiesCommand } from "@byline/admin/admin-permissions";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const listRegisteredAbilities = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { setRoleAbilitiesCommand } from "@byline/admin/admin-permissions";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const setRoleAbilities = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { whoHasAbilityCommand } from "@byline/admin/admin-permissions";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const whoHasAbility = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { createAdminRoleCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const createAdminRole = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { deleteAdminRoleCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const deleteAdminRole = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { getAdminRoleCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const getAdminRole = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { listAdminRolesCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const listAdminRoles = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { reorderAdminRolesCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const reorderAdminRoles = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { updateAdminRoleCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const updateAdminRole = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { createAdminUserCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const createAdminUser = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { deleteAdminUserCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const deleteAdminUser = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { disableAdminUserCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const disableAdminUser = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { enableAdminUserCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const enableAdminUser = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { getRolesForUserCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const getUserRoles = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { getAdminUserCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const getAdminUser = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { listAdminUsersCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const listAdminUsers = createServerFn({
6
6
  method: 'GET'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { setAdminUserPasswordCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const setAdminUserPassword = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { setRolesForUserCommand } from "@byline/admin/admin-roles";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const setUserRoles = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { updateAdminUserCommand } from "@byline/admin/admin-users";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const updateAdminUser = createServerFn({
6
6
  method: 'POST'
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { executeInstruction, executeInstructionStreaming } from "@byline/ai/server";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  const executeAiInstruction = createServerFn({
5
5
  method: 'POST'
6
6
  }).validator((input)=>input).handler(async ({ data })=>{
@@ -1,6 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { AuthError } from "@byline/auth";
3
- import { getAdminRequestContext } from "../../auth/auth-context.js";
3
+ import { getAdminRequestContext } from "@byline/client/server";
4
4
  import { bylineCore } from "../../integrations/byline-core.js";
5
5
  const getCurrentAdminUser = createServerFn({
6
6
  method: 'GET'
@@ -1,7 +1,7 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
2
  import { getRequestHeader } from "@tanstack/react-start/server";
3
+ import { setSessionCookies } from "@byline/client/server";
3
4
  import { getServerConfig } from "@byline/core";
4
- import { setSessionCookies } from "../../auth/auth-cookies.js";
5
5
  import { readAdminLocaleCookie } from "../../i18n/locale-cookie.js";
6
6
  import { bylineCore } from "../../integrations/byline-core.js";
7
7
  const adminSignIn = createServerFn({
@@ -1,7 +1,6 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
+ import { clearPreviewCookie, clearSessionCookies, readRefreshTokenCookie } from "@byline/client/server";
2
3
  import { getServerConfig } from "@byline/core";
3
- import { clearSessionCookies, readRefreshTokenCookie } from "../../auth/auth-cookies.js";
4
- import { clearPreviewCookie } from "../../auth/preview-cookies.js";
5
4
  const adminSignOut = createServerFn({
6
5
  method: 'POST'
7
6
  }).handler(async ()=>{
@@ -1,7 +1,7 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
+ import { getAdminBylineClient } from "@byline/client/server";
2
3
  import { ERR_NOT_FOUND, getLogger } from "@byline/core";
3
4
  import { ensureCollection } from "../../integrations/api-utils.js";
4
- import { getAdminBylineClient } from "../../integrations/byline-client.js";
5
5
  import { resolveActorLabels } from "./actors.js";
6
6
  const getCollectionDocumentAuditLog = createServerFn({
7
7
  method: 'GET'
@@ -1,7 +1,7 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
+ import { getAdminRequestContext } from "@byline/client/server";
2
3
  import { ERR_NOT_FOUND, getLogger, getServerConfig } from "@byline/core";
3
4
  import { copyToLocale } from "@byline/core/services";
4
- import { getAdminRequestContext } from "../../auth/auth-context.js";
5
5
  import { ensureCollection } from "../../integrations/api-utils.js";
6
6
  const copyDocumentToLocale = createServerFn({
7
7
  method: 'POST'