@byline/host-tanstack-start 4.0.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.
- package/dist/i18n/resolve-locale.js +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/integrations/host-bridge.d.ts +13 -0
- package/dist/integrations/host-bridge.js +22 -0
- package/dist/integrations/serve-uploads.d.ts +1 -0
- package/dist/integrations/serve-uploads.js +1 -0
- package/dist/server-fns/admin-account/change-password.js +1 -1
- package/dist/server-fns/admin-account/get.js +1 -1
- package/dist/server-fns/admin-account/update.js +1 -1
- package/dist/server-fns/admin-activity/get.js +1 -1
- package/dist/server-fns/admin-permissions/get-role-abilities.js +1 -1
- package/dist/server-fns/admin-permissions/list-registered.js +1 -1
- package/dist/server-fns/admin-permissions/set-role-abilities.js +1 -1
- package/dist/server-fns/admin-permissions/who-has.js +1 -1
- package/dist/server-fns/admin-roles/create.js +1 -1
- package/dist/server-fns/admin-roles/delete.js +1 -1
- package/dist/server-fns/admin-roles/get.js +1 -1
- package/dist/server-fns/admin-roles/list.js +1 -1
- package/dist/server-fns/admin-roles/reorder.js +1 -1
- package/dist/server-fns/admin-roles/update.js +1 -1
- package/dist/server-fns/admin-users/create.js +1 -1
- package/dist/server-fns/admin-users/delete.js +1 -1
- package/dist/server-fns/admin-users/disable.js +1 -1
- package/dist/server-fns/admin-users/enable.js +1 -1
- package/dist/server-fns/admin-users/get-user-roles.js +1 -1
- package/dist/server-fns/admin-users/get.js +1 -1
- package/dist/server-fns/admin-users/list.js +1 -1
- package/dist/server-fns/admin-users/set-password.js +1 -1
- package/dist/server-fns/admin-users/set-user-roles.js +1 -1
- package/dist/server-fns/admin-users/update.js +1 -1
- package/dist/server-fns/ai/execute.js +1 -1
- package/dist/server-fns/auth/current-user.js +1 -1
- package/dist/server-fns/auth/sign-in.js +1 -1
- package/dist/server-fns/auth/sign-out.js +1 -2
- package/dist/server-fns/collections/audit.js +1 -1
- package/dist/server-fns/collections/copy-to-locale.js +1 -1
- package/dist/server-fns/collections/create.js +1 -1
- package/dist/server-fns/collections/delete-locale.js +1 -1
- package/dist/server-fns/collections/delete.js +1 -1
- package/dist/server-fns/collections/duplicate.js +1 -1
- package/dist/server-fns/collections/get.js +1 -1
- package/dist/server-fns/collections/history.js +1 -1
- package/dist/server-fns/collections/list.js +1 -1
- package/dist/server-fns/collections/reindex.js +1 -1
- package/dist/server-fns/collections/reorder.js +1 -1
- package/dist/server-fns/collections/restore-version.js +1 -1
- package/dist/server-fns/collections/stats.js +1 -1
- package/dist/server-fns/collections/status.js +1 -1
- package/dist/server-fns/collections/tree.js +1 -1
- package/dist/server-fns/collections/update.js +1 -1
- package/dist/server-fns/collections/upload.js +1 -1
- package/dist/server-fns/i18n/set-locale.js +1 -1
- package/dist/server-fns/preview/disable.js +1 -1
- package/dist/server-fns/preview/enable.js +1 -2
- package/dist/server-fns/preview/state.js +1 -1
- package/package.json +8 -13
- package/src/i18n/resolve-locale.ts +1 -1
- package/src/index.ts +5 -6
- package/src/integrations/host-bridge.ts +56 -0
- package/src/integrations/serve-uploads.ts +6 -0
- package/src/server-fns/admin-account/change-password.ts +1 -1
- package/src/server-fns/admin-account/get.ts +1 -1
- package/src/server-fns/admin-account/update.ts +1 -1
- package/src/server-fns/admin-activity/get.ts +1 -1
- package/src/server-fns/admin-permissions/get-role-abilities.ts +1 -1
- package/src/server-fns/admin-permissions/list-registered.ts +1 -1
- package/src/server-fns/admin-permissions/set-role-abilities.ts +1 -1
- package/src/server-fns/admin-permissions/who-has.ts +1 -1
- package/src/server-fns/admin-roles/create.ts +1 -1
- package/src/server-fns/admin-roles/delete.ts +1 -1
- package/src/server-fns/admin-roles/get.ts +1 -1
- package/src/server-fns/admin-roles/list.ts +1 -1
- package/src/server-fns/admin-roles/reorder.ts +1 -1
- package/src/server-fns/admin-roles/update.ts +1 -1
- package/src/server-fns/admin-users/create.ts +1 -1
- package/src/server-fns/admin-users/delete.ts +1 -1
- package/src/server-fns/admin-users/disable.ts +1 -1
- package/src/server-fns/admin-users/enable.ts +1 -1
- package/src/server-fns/admin-users/get-user-roles.ts +1 -1
- package/src/server-fns/admin-users/get.ts +1 -1
- package/src/server-fns/admin-users/list.ts +1 -1
- package/src/server-fns/admin-users/set-password.ts +1 -1
- package/src/server-fns/admin-users/set-user-roles.ts +1 -1
- package/src/server-fns/admin-users/update.ts +1 -1
- package/src/server-fns/ai/execute.ts +1 -2
- package/src/server-fns/auth/current-user.ts +1 -1
- package/src/server-fns/auth/sign-in.ts +1 -1
- package/src/server-fns/auth/sign-out.ts +5 -3
- package/src/server-fns/collections/audit.ts +1 -1
- package/src/server-fns/collections/copy-to-locale.ts +1 -1
- package/src/server-fns/collections/create.ts +1 -1
- package/src/server-fns/collections/delete-locale.ts +1 -1
- package/src/server-fns/collections/delete.ts +1 -1
- package/src/server-fns/collections/duplicate.ts +1 -1
- package/src/server-fns/collections/get.ts +1 -1
- package/src/server-fns/collections/history.ts +1 -1
- package/src/server-fns/collections/list.ts +1 -1
- package/src/server-fns/collections/reindex.ts +1 -1
- package/src/server-fns/collections/reorder.ts +1 -1
- package/src/server-fns/collections/restore-version.ts +1 -1
- package/src/server-fns/collections/stats.ts +2 -1
- package/src/server-fns/collections/status.ts +1 -1
- package/src/server-fns/collections/tree.ts +1 -1
- package/src/server-fns/collections/update.ts +1 -1
- package/src/server-fns/collections/upload.ts +1 -1
- package/src/server-fns/i18n/set-locale.ts +1 -1
- package/src/server-fns/preview/disable.ts +1 -1
- package/src/server-fns/preview/enable.ts +1 -2
- package/src/server-fns/preview/state.ts +1 -1
- package/dist/auth/auth-context.d.ts +0 -50
- package/dist/auth/auth-context.js +0 -61
- package/dist/auth/auth-cookies.d.ts +0 -34
- package/dist/auth/auth-cookies.js +0 -46
- package/dist/auth/preview-cookies.d.ts +0 -19
- package/dist/auth/preview-cookies.js +0 -26
- package/dist/auth/request-scope.d.ts +0 -16
- package/dist/auth/request-scope.js +0 -24
- package/dist/integrations/byline-client.d.ts +0 -24
- package/dist/integrations/byline-client.js +0 -25
- package/dist/integrations/byline-public-client.d.ts +0 -47
- package/dist/integrations/byline-public-client.js +0 -19
- package/dist/integrations/byline-viewer-client.d.ts +0 -26
- package/dist/integrations/byline-viewer-client.js +0 -44
- package/src/auth/auth-context.test.node.ts +0 -302
- package/src/auth/auth-context.ts +0 -142
- package/src/auth/auth-cookies.ts +0 -113
- package/src/auth/preview-cookies.ts +0 -73
- package/src/auth/request-scope.test.node.ts +0 -93
- package/src/auth/request-scope.ts +0 -62
- package/src/integrations/byline-client.ts +0 -68
- package/src/integrations/byline-public-client.ts +0 -67
- package/src/integrations/byline-viewer-client.ts +0 -111
- package/src/integrations/request-context-contract.test.node.ts +0 -131
- package/src/integrations/request-context-factories.test.node.ts +0 -140
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestHeader } from "@tanstack/react-start/server";
|
|
2
2
|
import { AuthError, AuthErrorCodes } from "@byline/auth";
|
|
3
|
+
import { getAdminRequestContext } from "@byline/client/server";
|
|
3
4
|
import { resolveInterfaceLocale } from "@byline/i18n";
|
|
4
|
-
import { getAdminRequestContext } from "../auth/auth-context.js";
|
|
5
5
|
import { bylineCore } from "../integrations/byline-core.js";
|
|
6
6
|
import { readAdminLocaleCookie } from "./locale-cookie.js";
|
|
7
7
|
async function resolveRequestLocale(options) {
|
package/dist/index.d.ts
CHANGED
|
@@ -18,14 +18,13 @@
|
|
|
18
18
|
* - `@byline/host-tanstack-start/server-fns/<module>` — TanStack Start
|
|
19
19
|
* server functions for each admin module (admin-account, admin-roles,
|
|
20
20
|
* admin-users, admin-permissions, auth, collections).
|
|
21
|
-
* - `@byline/host-tanstack-start/auth/auth-context` — request-scoped
|
|
22
|
-
* `RequestContext` resolution that reads session cookies, refreshes
|
|
23
|
-
* transparently, and surfaces `ERR_UNAUTHENTICATED` to callers.
|
|
24
21
|
* - `@byline/host-tanstack-start/integrations/*` — host-side adapters
|
|
25
22
|
* binding TanStack Start primitives to the framework-neutral
|
|
26
|
-
* contracts in `@byline/ui
|
|
27
|
-
* (`bylineFieldServices`, `bylineAdminServices`,
|
|
28
|
-
* `
|
|
23
|
+
* contracts in `@byline/ui`, `@byline/core`, and `@byline/client`
|
|
24
|
+
* (`bylineFieldServices`, `bylineAdminServices`, and `host-bridge` —
|
|
25
|
+
* the `HostRequestBridge` implementation behind the
|
|
26
|
+
* `@byline/client/server` getters; request-context resolution and the
|
|
27
|
+
* client singletons themselves live in `@byline/client/server`).
|
|
29
28
|
* - `@byline/host-tanstack-start/admin-shell/{chrome,collections,...}` —
|
|
30
29
|
* router-coupled admin UI: shared shell chrome (menu drawer, app bar,
|
|
31
30
|
* route-error, breadcrumbs, etc.) plus per-area page containers.
|
|
@@ -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
|
+
/**
|
|
9
|
+
* Register the TanStack Start bridge. Safe to call any number of times;
|
|
10
|
+
* exported for hosts that want registration to be explicit in their
|
|
11
|
+
* server config rather than relying on a side-effect import.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerTanstackStartHostBridge(): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getCookie, getRequest, setCookie } from "@tanstack/react-start/server";
|
|
2
|
+
import { registerHostRequestBridge } from "@byline/core";
|
|
3
|
+
const tanstackStartRequestBridge = {
|
|
4
|
+
getRequest () {
|
|
5
|
+
try {
|
|
6
|
+
return getRequest();
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
getCookie (name) {
|
|
12
|
+
return getCookie(name);
|
|
13
|
+
},
|
|
14
|
+
setCookie (name, value, options) {
|
|
15
|
+
setCookie(name, value, options);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function registerTanstackStartHostBridge() {
|
|
19
|
+
registerHostRequestBridge(tanstackStartRequestBridge);
|
|
20
|
+
}
|
|
21
|
+
registerTanstackStartHostBridge();
|
|
22
|
+
export { registerTanstackStartHostBridge };
|
|
@@ -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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
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'
|
|
@@ -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 { createDocument } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const createCollectionDocument = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
@@ -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 { deleteLocale } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const deleteDocumentLocale = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
@@ -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, getUploadFields } from "@byline/core";
|
|
3
4
|
import { deleteDocument } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
import { toDeleteDocumentResponse } from "./delete-outcome.js";
|
|
7
7
|
const delete_deleteDocument = createServerFn({
|
|
@@ -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 { duplicateDocument } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const duplicateCollectionDocument = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
+
import { getAdminBylineClient } from "@byline/client/server";
|
|
2
3
|
import { BylineError, ERR_NOT_FOUND, ErrorCodes, buildRelationSummaryPopulateMap, getCollectionAdminConfig, getCollectionDefinition, getCollectionSchemasForPath, getLogger, getServerConfig } from "@byline/core";
|
|
3
4
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
4
|
-
import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
5
5
|
import { serialise } from "./utils.js";
|
|
6
6
|
const getDocumentFn = createServerFn({
|
|
7
7
|
method: 'GET'
|
|
@@ -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, getCollectionSchemasForPath, 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
|
import { serialise } from "./utils.js";
|
|
7
7
|
const getCollectionDocumentHistory = createServerFn({
|
|
@@ -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, buildRelationSummaryPopulateMap, getCollectionAdminConfig, getCollectionDefinition, getCollectionSchemasForPath, getLogger, getServerConfig } from "@byline/core";
|
|
3
4
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
4
|
-
import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
5
5
|
import { serialise } from "./utils.js";
|
|
6
6
|
const getCollectionDocuments = createServerFn({
|
|
7
7
|
method: 'GET'
|
|
@@ -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
|
const reindexCollection = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
7
|
}).validator((input)=>input).handler(async ({ data })=>{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
+
import { getAdminRequestContext } from "@byline/client/server";
|
|
2
3
|
import { ERR_NOT_FOUND, ERR_VALIDATION, assertActorCanPerform, generateKeyBetween, generateNKeysBetween, getLogger, getServerConfig } from "@byline/core";
|
|
3
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
4
4
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
5
5
|
const reorderCollectionDocument = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
@@ -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 { restoreDocumentVersion } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const restore_version_restoreDocumentVersion = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
+
import { getAdminBylineClient } from "@byline/client/server";
|
|
2
3
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
3
|
-
import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
4
4
|
const getCollectionStatsFn = createServerFn({
|
|
5
5
|
method: 'GET'
|
|
6
6
|
}).validator((input)=>input).handler(async ({ data })=>{
|
|
@@ -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 { changeDocumentStatus, unpublishDocument } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const updateDocumentStatus = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
@@ -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, createReadContext, getLogger } from "@byline/core";
|
|
3
4
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
4
|
-
import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
5
5
|
import { placeAdminTreeNode, removeAdminTreeNode } from "./tree-mutation.js";
|
|
6
6
|
import { getAdminTreeParent, getAdminUnplacedTreeDocuments } from "./tree-read.js";
|
|
7
7
|
const placeTreeNode = createServerFn({
|
|
@@ -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 { updateDocumentSystemFields, updateDocumentWithPatches } from "@byline/core/services";
|
|
4
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const updateCollectionDocumentWithPatches = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
+
import { getAdminRequestContext } from "@byline/client/server";
|
|
2
3
|
import { ERR_NOT_FOUND, ERR_VALIDATION, getServerConfig, getUploadFields } from "@byline/core";
|
|
3
4
|
import { extractImageMeta, generateImageVariants, isBypassMimeType } from "@byline/core/image";
|
|
4
5
|
import { getLogger, withLogContext } from "@byline/core/logger";
|
|
5
6
|
import { uploadField } from "@byline/core/services";
|
|
6
|
-
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
7
7
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
8
8
|
function parseUploadFormData(data) {
|
|
9
9
|
if (!(data instanceof FormData)) throw new Error('Expected FormData upload payload.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
2
|
import { setPreferredLocaleCommand } from "@byline/admin/admin-account";
|
|
3
3
|
import { AuthError, AuthErrorCodes } from "@byline/auth";
|
|
4
|
-
import { getAdminRequestContext } from "
|
|
4
|
+
import { getAdminRequestContext } from "@byline/client/server";
|
|
5
5
|
import { clearAdminLocaleCookie, setAdminLocaleCookie } from "../../i18n/locale-cookie.js";
|
|
6
6
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
7
7
|
const setInterfaceLocaleFn = createServerFn({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { clearPreviewCookie } from "
|
|
2
|
+
import { clearPreviewCookie } from "@byline/client/server";
|
|
3
3
|
const disablePreviewModeFn = createServerFn({
|
|
4
4
|
method: 'POST'
|
|
5
5
|
}).handler(async ()=>{
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { getAdminRequestContext } from "
|
|
3
|
-
import { setPreviewCookie } from "../../auth/preview-cookies.js";
|
|
2
|
+
import { getAdminRequestContext, setPreviewCookie } from "@byline/client/server";
|
|
4
3
|
const enablePreviewModeFn = createServerFn({
|
|
5
4
|
method: 'POST'
|
|
6
5
|
}).handler(async ()=>{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { readPreviewCookie } from "
|
|
2
|
+
import { readPreviewCookie } from "@byline/client/server";
|
|
3
3
|
const getPreviewStateFn = createServerFn({
|
|
4
4
|
method: 'GET'
|
|
5
5
|
}).handler(async ()=>({
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "4.
|
|
6
|
+
"version": "4.1.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20.9.0"
|
|
9
9
|
},
|
|
@@ -89,10 +89,6 @@
|
|
|
89
89
|
"types": "./dist/server-fns/*.d.ts",
|
|
90
90
|
"import": "./dist/server-fns/*.js"
|
|
91
91
|
},
|
|
92
|
-
"./auth/*": {
|
|
93
|
-
"types": "./dist/auth/*.d.ts",
|
|
94
|
-
"import": "./dist/auth/*.js"
|
|
95
|
-
},
|
|
96
92
|
"./integrations/*": {
|
|
97
93
|
"types": "./dist/integrations/*.d.ts",
|
|
98
94
|
"import": "./dist/integrations/*.js"
|
|
@@ -121,15 +117,14 @@
|
|
|
121
117
|
"npm-run-all": "^4.1.5",
|
|
122
118
|
"react-json-view-lite": "^2.5.0",
|
|
123
119
|
"react-swipeable": "^7.0.2",
|
|
124
|
-
"uuid": "^14.0.1",
|
|
125
120
|
"zod": "^4.4.3",
|
|
126
|
-
"@byline/
|
|
127
|
-
"@byline/
|
|
128
|
-
"@byline/
|
|
129
|
-
"@byline/
|
|
130
|
-
"@byline/
|
|
131
|
-
"@byline/
|
|
132
|
-
"@byline/core": "4.
|
|
121
|
+
"@byline/ai": "4.1.0",
|
|
122
|
+
"@byline/admin": "4.1.0",
|
|
123
|
+
"@byline/auth": "4.1.0",
|
|
124
|
+
"@byline/client": "4.1.0",
|
|
125
|
+
"@byline/i18n": "4.1.0",
|
|
126
|
+
"@byline/ui": "4.1.0",
|
|
127
|
+
"@byline/core": "4.1.0"
|
|
133
128
|
},
|
|
134
129
|
"peerDependencies": {
|
|
135
130
|
"@tanstack/react-router": "^1.167.0",
|