@byline/host-tanstack-start 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-permissions/get-role-abilities.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/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/sign-in.js +1 -1
- 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 +2 -2
- package/dist/server-fns/collections/history.js +1 -1
- package/dist/server-fns/collections/list.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 +2 -2
- package/dist/server-fns/collections/update.js +2 -2
- package/dist/server-fns/collections/upload.js +1 -1
- package/dist/server-fns/i18n/set-locale.js +1 -1
- package/package.json +10 -10
- 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-permissions/get-role-abilities.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/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 -1
- package/src/server-fns/auth/sign-in.ts +1 -1
- package/src/server-fns/collections/audit.ts +1 -3
- 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 +2 -2
- package/src/server-fns/collections/history.ts +1 -1
- package/src/server-fns/collections/list.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 +1 -1
- package/src/server-fns/collections/status.ts +2 -2
- package/src/server-fns/collections/update.ts +2 -2
- package/src/server-fns/collections/upload.ts +1 -1
- package/src/server-fns/i18n/set-locale.ts +1 -1
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const changeAccountPassword = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return changeAccountPasswordCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const getAccount = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input ?? {}).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return getAccountCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const updateAccount = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return updateAccountCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const getRoleAbilities = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return getRoleAbilitiesCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore,
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const setRoleAbilities = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return setRoleAbilitiesCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore,
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const whoHasAbility = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return whoHasAbilityCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore,
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const createAdminRole = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return createAdminRoleCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const deleteAdminRole = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return deleteAdminRoleCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const getAdminRole = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return getAdminRoleCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const reorderAdminRoles = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return reorderAdminRolesCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const updateAdminRole = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return updateAdminRoleCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const createAdminUser = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return createAdminUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const deleteAdminUser = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return deleteAdminUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const disableAdminUser = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return disableAdminUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const enableAdminUser = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return enableAdminUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const getUserRoles = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return getRolesForUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const getAdminUser = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return getAdminUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const listAdminUsers = createServerFn({
|
|
6
6
|
method: 'GET'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input ?? {}).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return listAdminUsersCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const setAdminUserPassword = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return setAdminUserPasswordCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const setUserRoles = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return setRolesForUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -4,7 +4,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
4
4
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
5
5
|
const updateAdminUser = createServerFn({
|
|
6
6
|
method: 'POST'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
8
8
|
const context = await getAdminRequestContext();
|
|
9
9
|
return updateAdminUserCommand(context, data, {
|
|
10
10
|
store: bylineCore().adminStore
|
|
@@ -3,7 +3,7 @@ import { executeInstruction, executeInstructionStreaming } from "@byline/ai/serv
|
|
|
3
3
|
import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
4
4
|
const executeAiInstruction = createServerFn({
|
|
5
5
|
method: 'POST'
|
|
6
|
-
}).
|
|
6
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
7
7
|
await getAdminRequestContext();
|
|
8
8
|
if (data.options?.streaming) {
|
|
9
9
|
const streamResult = executeInstructionStreaming(data.params, data.options);
|
|
@@ -6,7 +6,7 @@ import { readAdminLocaleCookie } from "../../i18n/locale-cookie.js";
|
|
|
6
6
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
7
7
|
const adminSignIn = createServerFn({
|
|
8
8
|
method: 'POST'
|
|
9
|
-
}).
|
|
9
|
+
}).validator((input)=>{
|
|
10
10
|
if ('string' != typeof input?.email || 0 === input.email.length) throw new Error('email is required');
|
|
11
11
|
if ('string' != typeof input?.password || 0 === input.password.length) throw new Error('password is required');
|
|
12
12
|
return {
|
|
@@ -5,7 +5,7 @@ import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
|
5
5
|
import { resolveActorLabels } from "./actors.js";
|
|
6
6
|
const getCollectionDocumentAuditLog = createServerFn({
|
|
7
7
|
method: 'GET'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
9
9
|
const { collection: path, id, params } = data;
|
|
10
10
|
const config = await ensureCollection(path);
|
|
11
11
|
if (!config) throw ERR_NOT_FOUND({
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id, sourceLocale, targetLocale, overwrite } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, data: documentData, locale, path: explicitPath, availableLocales } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id, locale } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ import { getAdminRequestContext } from "../../auth/auth-context.js";
|
|
|
5
5
|
import { ensureCollection } from "../../integrations/api-utils.js";
|
|
6
6
|
const delete_deleteDocument = createServerFn({
|
|
7
7
|
method: 'POST'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id: sourceDocumentId } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
|
5
5
|
import { serialise } from "./utils.js";
|
|
6
6
|
const getDocumentFn = createServerFn({
|
|
7
7
|
method: 'GET'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
9
9
|
const { collection: path, id, locale, depth, populateRelations } = data;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -88,7 +88,7 @@ const getDocumentFn = createServerFn({
|
|
|
88
88
|
});
|
|
89
89
|
const getDocumentByVersionFn = createServerFn({
|
|
90
90
|
method: 'GET'
|
|
91
|
-
}).
|
|
91
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
92
92
|
const { collection: path, versionId, locale } = data;
|
|
93
93
|
const resolvedLocale = locale ?? 'all';
|
|
94
94
|
const logger = getLogger();
|
|
@@ -6,7 +6,7 @@ import { resolveActorLabels } from "./actors.js";
|
|
|
6
6
|
import { serialise } from "./utils.js";
|
|
7
7
|
const getCollectionDocumentHistory = createServerFn({
|
|
8
8
|
method: 'GET'
|
|
9
|
-
}).
|
|
9
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
10
10
|
const { collection: path, id, params } = data;
|
|
11
11
|
const config = await ensureCollection(path);
|
|
12
12
|
if (!config) throw ERR_NOT_FOUND({
|
|
@@ -5,7 +5,7 @@ import { getAdminBylineClient } from "../../integrations/byline-client.js";
|
|
|
5
5
|
import { serialise } from "./utils.js";
|
|
6
6
|
const getCollectionDocuments = createServerFn({
|
|
7
7
|
method: 'GET'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
9
9
|
const { collection: path, params } = data;
|
|
10
10
|
const config = await ensureCollection(path);
|
|
11
11
|
if (!config) throw ERR_NOT_FOUND({
|
|
@@ -4,7 +4,7 @@ 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'
|
|
7
|
-
}).
|
|
7
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
8
8
|
const { collection: path, documentId, beforeDocumentId, afterDocumentId } = input;
|
|
9
9
|
const logger = getLogger();
|
|
10
10
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id, versionId } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -3,7 +3,7 @@ import { ensureCollection } from "../../integrations/api-utils.js";
|
|
|
3
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 })=>{
|
|
7
7
|
const config = await ensureCollection(data.collection);
|
|
8
8
|
if (!config) return {
|
|
9
9
|
stats: []
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id, status: nextStatus } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -39,7 +39,7 @@ const updateDocumentStatus = createServerFn({
|
|
|
39
39
|
});
|
|
40
40
|
const status_unpublishDocument = createServerFn({
|
|
41
41
|
method: 'POST'
|
|
42
|
-
}).
|
|
42
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
43
43
|
const { collection: path, id } = input;
|
|
44
44
|
const logger = getLogger();
|
|
45
45
|
const config = await ensureCollection(path);
|
|
@@ -5,7 +5,7 @@ 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'
|
|
8
|
-
}).
|
|
8
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
9
9
|
const { collection: path, id, patches, versionId, locale } = input;
|
|
10
10
|
const logger = getLogger();
|
|
11
11
|
const config = await ensureCollection(path);
|
|
@@ -39,7 +39,7 @@ const updateCollectionDocumentWithPatches = createServerFn({
|
|
|
39
39
|
});
|
|
40
40
|
const updateCollectionDocumentSystemFields = createServerFn({
|
|
41
41
|
method: 'POST'
|
|
42
|
-
}).
|
|
42
|
+
}).validator((input)=>input).handler(async ({ data: input })=>{
|
|
43
43
|
const { collection: path, id, locale, path: explicitPath, availableLocales } = input;
|
|
44
44
|
const logger = getLogger();
|
|
45
45
|
const config = await ensureCollection(path);
|
|
@@ -56,7 +56,7 @@ function resolveUploadFieldName(definition, collectionPath, requested) {
|
|
|
56
56
|
}
|
|
57
57
|
const uploadCollectionField = createServerFn({
|
|
58
58
|
method: 'POST'
|
|
59
|
-
}).
|
|
59
|
+
}).validator(parseUploadFormData).handler(async ({ data })=>{
|
|
60
60
|
const { collectionPath, shouldCreateDocument, fieldName, file, fields } = data;
|
|
61
61
|
const logger = getLogger();
|
|
62
62
|
return withLogContext({
|
|
@@ -6,7 +6,7 @@ import { clearAdminLocaleCookie, setAdminLocaleCookie } from "../../i18n/locale-
|
|
|
6
6
|
import { bylineCore } from "../../integrations/byline-core.js";
|
|
7
7
|
const setInterfaceLocaleFn = createServerFn({
|
|
8
8
|
method: 'POST'
|
|
9
|
-
}).
|
|
9
|
+
}).validator((input)=>input).handler(async ({ data })=>{
|
|
10
10
|
const core = bylineCore();
|
|
11
11
|
const locales = core.config.i18n.interface.locales;
|
|
12
12
|
if (null != data.locale && !locales.includes(data.locale)) throw new Error(`[setInterfaceLocaleFn] locale '${data.locale}' is not in i18n.interface.locales [${locales.join(', ')}].`);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "3.10.
|
|
6
|
+
"version": "3.10.1",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20.9.0"
|
|
9
9
|
},
|
|
@@ -115,13 +115,13 @@
|
|
|
115
115
|
"react-swipeable": "^7.0.2",
|
|
116
116
|
"uuid": "^14.0.0",
|
|
117
117
|
"zod": "^4.4.3",
|
|
118
|
-
"@byline/admin": "3.10.
|
|
119
|
-
"@byline/
|
|
120
|
-
"@byline/
|
|
121
|
-
"@byline/
|
|
122
|
-
"@byline/
|
|
123
|
-
"@byline/
|
|
124
|
-
"@byline/
|
|
118
|
+
"@byline/admin": "3.10.1",
|
|
119
|
+
"@byline/ui": "3.10.1",
|
|
120
|
+
"@byline/i18n": "3.10.1",
|
|
121
|
+
"@byline/core": "3.10.1",
|
|
122
|
+
"@byline/client": "3.10.1",
|
|
123
|
+
"@byline/ai": "3.10.1",
|
|
124
|
+
"@byline/auth": "3.10.1"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
127
|
"@tanstack/react-router": "^1.167.0",
|
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
"@biomejs/biome": "2.4.15",
|
|
134
134
|
"@rsbuild/plugin-react": "^2.0.0",
|
|
135
135
|
"@rslib/core": "^0.21.5",
|
|
136
|
-
"@tanstack/react-router": "^1.170.
|
|
137
|
-
"@tanstack/react-start": "^1.168.
|
|
136
|
+
"@tanstack/react-router": "^1.170.15",
|
|
137
|
+
"@tanstack/react-start": "^1.168.25",
|
|
138
138
|
"@types/node": "^25.9.1",
|
|
139
139
|
"@types/react": "19.2.15",
|
|
140
140
|
"@types/react-dom": "19.2.3",
|
|
@@ -20,7 +20,7 @@ export interface ChangeAccountPasswordInput {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const changeAccountPassword = createServerFn({ method: 'POST' })
|
|
23
|
-
.
|
|
23
|
+
.validator((input: ChangeAccountPasswordInput) => input)
|
|
24
24
|
.handler(async ({ data }): Promise<AccountResponse> => {
|
|
25
25
|
const context = await getAdminRequestContext()
|
|
26
26
|
return changeAccountPasswordCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -20,7 +20,7 @@ import { bylineCore } from '../../integrations/byline-core.js'
|
|
|
20
20
|
* doesn't carry.
|
|
21
21
|
*/
|
|
22
22
|
export const getAccount = createServerFn({ method: 'GET' })
|
|
23
|
-
.
|
|
23
|
+
.validator((input?: Record<string, never>) => input ?? {})
|
|
24
24
|
.handler(async ({ data }): Promise<AccountResponse> => {
|
|
25
25
|
const context = await getAdminRequestContext()
|
|
26
26
|
return getAccountCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -24,7 +24,7 @@ export interface UpdateAccountInput {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const updateAccount = createServerFn({ method: 'POST' })
|
|
27
|
-
.
|
|
27
|
+
.validator((input: UpdateAccountInput) => input)
|
|
28
28
|
.handler(async ({ data }): Promise<AccountResponse> => {
|
|
29
29
|
const context = await getAdminRequestContext()
|
|
30
30
|
return updateAccountCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -17,7 +17,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
17
17
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
18
18
|
|
|
19
19
|
export const getRoleAbilities = createServerFn({ method: 'GET' })
|
|
20
|
-
.
|
|
20
|
+
.validator((input: { id: string }) => input)
|
|
21
21
|
.handler(async ({ data }): Promise<GetRoleAbilitiesResponse> => {
|
|
22
22
|
const context = await getAdminRequestContext()
|
|
23
23
|
return getRoleAbilitiesCommand(context, data, {
|
|
@@ -22,7 +22,7 @@ export interface SetRoleAbilitiesInput {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const setRoleAbilities = createServerFn({ method: 'POST' })
|
|
25
|
-
.
|
|
25
|
+
.validator((input: SetRoleAbilitiesInput) => input)
|
|
26
26
|
.handler(async ({ data }): Promise<SetRoleAbilitiesResponse> => {
|
|
27
27
|
const context = await getAdminRequestContext()
|
|
28
28
|
return setRoleAbilitiesCommand(context, data, {
|
|
@@ -14,7 +14,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
14
14
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
15
15
|
|
|
16
16
|
export const whoHasAbility = createServerFn({ method: 'GET' })
|
|
17
|
-
.
|
|
17
|
+
.validator((input: { ability: string }) => input)
|
|
18
18
|
.handler(async ({ data }): Promise<WhoHasAbilityResponse> => {
|
|
19
19
|
const context = await getAdminRequestContext()
|
|
20
20
|
return whoHasAbilityCommand(context, data, {
|
|
@@ -21,7 +21,7 @@ export interface CreateAdminRoleInput {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const createAdminRole = createServerFn({ method: 'POST' })
|
|
24
|
-
.
|
|
24
|
+
.validator((input: CreateAdminRoleInput) => input)
|
|
25
25
|
.handler(async ({ data }): Promise<AdminRoleResponse> => {
|
|
26
26
|
const context = await getAdminRequestContext()
|
|
27
27
|
return createAdminRoleCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -18,7 +18,7 @@ import { bylineCore } from '../../integrations/byline-core.js'
|
|
|
18
18
|
// modules each declare their own identical `OkResponse` today, and the
|
|
19
19
|
// root `@byline/admin` barrel can only re-export one of them.
|
|
20
20
|
export const deleteAdminRole = createServerFn({ method: 'POST' })
|
|
21
|
-
.
|
|
21
|
+
.validator((input: { id: string; vid: number }) => input)
|
|
22
22
|
.handler(async ({ data }): Promise<{ ok: true }> => {
|
|
23
23
|
const context = await getAdminRequestContext()
|
|
24
24
|
return deleteAdminRoleCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -14,7 +14,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
14
14
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
15
15
|
|
|
16
16
|
export const getAdminRole = createServerFn({ method: 'GET' })
|
|
17
|
-
.
|
|
17
|
+
.validator((input: { id: string }) => input)
|
|
18
18
|
.handler(async ({ data }): Promise<AdminRoleResponse> => {
|
|
19
19
|
const context = await getAdminRequestContext()
|
|
20
20
|
return getAdminRoleCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -14,7 +14,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
14
14
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
15
15
|
|
|
16
16
|
export const reorderAdminRoles = createServerFn({ method: 'POST' })
|
|
17
|
-
.
|
|
17
|
+
.validator((input: { ids: string[] }) => input)
|
|
18
18
|
.handler(async ({ data }): Promise<{ ok: true }> => {
|
|
19
19
|
const context = await getAdminRequestContext()
|
|
20
20
|
return reorderAdminRolesCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -24,7 +24,7 @@ export interface UpdateAdminRoleInput {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const updateAdminRole = createServerFn({ method: 'POST' })
|
|
27
|
-
.
|
|
27
|
+
.validator((input: UpdateAdminRoleInput) => input)
|
|
28
28
|
.handler(async ({ data }): Promise<AdminRoleResponse> => {
|
|
29
29
|
const context = await getAdminRequestContext()
|
|
30
30
|
return updateAdminRoleCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -25,7 +25,7 @@ export interface CreateAdminUserInput {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const createAdminUser = createServerFn({ method: 'POST' })
|
|
28
|
-
.
|
|
28
|
+
.validator((input: CreateAdminUserInput) => input)
|
|
29
29
|
.handler(async ({ data }): Promise<AdminUserResponse> => {
|
|
30
30
|
const context = await getAdminRequestContext()
|
|
31
31
|
return createAdminUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -14,7 +14,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
14
14
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
15
15
|
|
|
16
16
|
export const deleteAdminUser = createServerFn({ method: 'POST' })
|
|
17
|
-
.
|
|
17
|
+
.validator((input: { id: string; vid: number }) => input)
|
|
18
18
|
.handler(async ({ data }): Promise<OkResponse> => {
|
|
19
19
|
const context = await getAdminRequestContext()
|
|
20
20
|
return deleteAdminUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -17,7 +17,7 @@ import { bylineCore } from '../../integrations/byline-core.js'
|
|
|
17
17
|
// detail-view enable/disable control they will be wired into. Keep until
|
|
18
18
|
// that control lands; not dead code.
|
|
19
19
|
export const disableAdminUser = createServerFn({ method: 'POST' })
|
|
20
|
-
.
|
|
20
|
+
.validator((input: { id: string }) => input)
|
|
21
21
|
.handler(async ({ data }): Promise<OkResponse> => {
|
|
22
22
|
const context = await getAdminRequestContext()
|
|
23
23
|
return disableAdminUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -17,7 +17,7 @@ import { bylineCore } from '../../integrations/byline-core.js'
|
|
|
17
17
|
// detail-view enable/disable control they will be wired into. Keep until
|
|
18
18
|
// that control lands; not dead code.
|
|
19
19
|
export const enableAdminUser = createServerFn({ method: 'POST' })
|
|
20
|
-
.
|
|
20
|
+
.validator((input: { id: string }) => input)
|
|
21
21
|
.handler(async ({ data }): Promise<OkResponse> => {
|
|
22
22
|
const context = await getAdminRequestContext()
|
|
23
23
|
return enableAdminUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -14,7 +14,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
14
14
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
15
15
|
|
|
16
16
|
export const getUserRoles = createServerFn({ method: 'GET' })
|
|
17
|
-
.
|
|
17
|
+
.validator((input: { userId: string }) => input)
|
|
18
18
|
.handler(async ({ data }): Promise<UserRolesResponse> => {
|
|
19
19
|
const context = await getAdminRequestContext()
|
|
20
20
|
return getRolesForUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -14,7 +14,7 @@ import { getAdminRequestContext } from '../../auth/auth-context.js'
|
|
|
14
14
|
import { bylineCore } from '../../integrations/byline-core.js'
|
|
15
15
|
|
|
16
16
|
export const getAdminUser = createServerFn({ method: 'GET' })
|
|
17
|
-
.
|
|
17
|
+
.validator((input: { id: string }) => input)
|
|
18
18
|
.handler(async ({ data }): Promise<AdminUserResponse> => {
|
|
19
19
|
const context = await getAdminRequestContext()
|
|
20
20
|
return getAdminUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -33,7 +33,7 @@ export interface ListAdminUsersInput {
|
|
|
33
33
|
* TanStack Start transport layer for the client to branch on.
|
|
34
34
|
*/
|
|
35
35
|
export const listAdminUsers = createServerFn({ method: 'GET' })
|
|
36
|
-
.
|
|
36
|
+
.validator((input: ListAdminUsersInput) => input ?? {})
|
|
37
37
|
.handler(async ({ data }): Promise<AdminUserListResponse> => {
|
|
38
38
|
const context = await getAdminRequestContext()
|
|
39
39
|
return listAdminUsersCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -20,7 +20,7 @@ export interface SetAdminUserPasswordInput {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const setAdminUserPassword = createServerFn({ method: 'POST' })
|
|
23
|
-
.
|
|
23
|
+
.validator((input: SetAdminUserPasswordInput) => input)
|
|
24
24
|
.handler(async ({ data }): Promise<AdminUserResponse> => {
|
|
25
25
|
const context = await getAdminRequestContext()
|
|
26
26
|
return setAdminUserPasswordCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -19,7 +19,7 @@ export interface SetUserRolesInput {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const setUserRoles = createServerFn({ method: 'POST' })
|
|
22
|
-
.
|
|
22
|
+
.validator((input: SetUserRolesInput) => input)
|
|
23
23
|
.handler(async ({ data }): Promise<UserRolesResponse> => {
|
|
24
24
|
const context = await getAdminRequestContext()
|
|
25
25
|
return setRolesForUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -27,7 +27,7 @@ export interface UpdateAdminUserInput {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const updateAdminUser = createServerFn({ method: 'POST' })
|
|
30
|
-
.
|
|
30
|
+
.validator((input: UpdateAdminUserInput) => input)
|
|
31
31
|
.handler(async ({ data }): Promise<AdminUserResponse> => {
|
|
32
32
|
const context = await getAdminRequestContext()
|
|
33
33
|
return updateAdminUserCommand(context, data, { store: bylineCore().adminStore! })
|
|
@@ -38,7 +38,7 @@ type ExecuteAiInstructionInput = {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const executeAiInstruction = createServerFn({ method: 'POST' })
|
|
41
|
-
.
|
|
41
|
+
.validator((input: ExecuteAiInstructionInput) => input)
|
|
42
42
|
.handler(async ({ data }): Promise<Response> => {
|
|
43
43
|
// Throws ERR_UNAUTHENTICATED if there is no admin session.
|
|
44
44
|
await getAdminRequestContext()
|
|
@@ -36,7 +36,7 @@ export interface SignInResult {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export const adminSignIn = createServerFn({ method: 'POST' })
|
|
39
|
-
.
|
|
39
|
+
.validator((input: SignInInput) => {
|
|
40
40
|
if (typeof input?.email !== 'string' || input.email.length === 0) {
|
|
41
41
|
throw new Error('email is required')
|
|
42
42
|
}
|
|
@@ -49,9 +49,7 @@ export interface AuditLogEntryDto {
|
|
|
49
49
|
// ---------------------------------------------------------------------------
|
|
50
50
|
|
|
51
51
|
export const getCollectionDocumentAuditLog = createServerFn({ method: 'GET' })
|
|
52
|
-
.
|
|
53
|
-
(input: { collection: string; id: string; params?: AuditLogSearchParams }) => input
|
|
54
|
-
)
|
|
52
|
+
.validator((input: { collection: string; id: string; params?: AuditLogSearchParams }) => input)
|
|
55
53
|
.handler(async ({ data }) => {
|
|
56
54
|
const { collection: path, id, params } = data
|
|
57
55
|
const config = await ensureCollection(path)
|
|
@@ -29,7 +29,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
29
29
|
* failures propagate to TanStack Start's transport layer.
|
|
30
30
|
*/
|
|
31
31
|
export const copyDocumentToLocale = createServerFn({ method: 'POST' })
|
|
32
|
-
.
|
|
32
|
+
.validator(
|
|
33
33
|
(input: {
|
|
34
34
|
collection: string
|
|
35
35
|
id: string
|
|
@@ -20,7 +20,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
|
|
22
22
|
export const createCollectionDocument = createServerFn({ method: 'POST' })
|
|
23
|
-
.
|
|
23
|
+
.validator(
|
|
24
24
|
(input: {
|
|
25
25
|
collection: string
|
|
26
26
|
data: any
|
|
@@ -30,7 +30,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
30
30
|
* transport layer.
|
|
31
31
|
*/
|
|
32
32
|
export const deleteDocumentLocale = createServerFn({ method: 'POST' })
|
|
33
|
-
.
|
|
33
|
+
.validator((input: { collection: string; id: string; locale: string }) => input)
|
|
34
34
|
.handler(async ({ data: input }): Promise<DeleteLocaleResult> => {
|
|
35
35
|
const { collection: path, id, locale } = input
|
|
36
36
|
const logger = getLogger()
|
|
@@ -20,7 +20,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
|
|
22
22
|
export const deleteDocument = createServerFn({ method: 'POST' })
|
|
23
|
-
.
|
|
23
|
+
.validator((input: { collection: string; id: string }) => input)
|
|
24
24
|
.handler(async ({ data: input }) => {
|
|
25
25
|
const { collection: path, id } = input
|
|
26
26
|
const logger = getLogger()
|
|
@@ -31,7 +31,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
31
31
|
* TanStack Start's transport layer for the client to branch on.
|
|
32
32
|
*/
|
|
33
33
|
export const duplicateCollectionDocument = createServerFn({ method: 'POST' })
|
|
34
|
-
.
|
|
34
|
+
.validator((input: { collection: string; id: string }) => input)
|
|
35
35
|
.handler(async ({ data: input }): Promise<DuplicateDocumentResult> => {
|
|
36
36
|
const { collection: path, id: sourceDocumentId } = input
|
|
37
37
|
const logger = getLogger()
|
|
@@ -30,7 +30,7 @@ import { serialise } from './utils'
|
|
|
30
30
|
// ---------------------------------------------------------------------------
|
|
31
31
|
|
|
32
32
|
const getDocumentFn = createServerFn({ method: 'GET' })
|
|
33
|
-
.
|
|
33
|
+
.validator(
|
|
34
34
|
(input: {
|
|
35
35
|
collection: string
|
|
36
36
|
id: string
|
|
@@ -183,7 +183,7 @@ const getDocumentFn = createServerFn({ method: 'GET' })
|
|
|
183
183
|
// ---------------------------------------------------------------------------
|
|
184
184
|
|
|
185
185
|
const getDocumentByVersionFn = createServerFn({ method: 'GET' })
|
|
186
|
-
.
|
|
186
|
+
.validator((input: { collection: string; versionId: string; locale?: string }) => input)
|
|
187
187
|
.handler(async ({ data }) => {
|
|
188
188
|
const { collection: path, versionId, locale } = data
|
|
189
189
|
const resolvedLocale = locale ?? 'all'
|
|
@@ -32,7 +32,7 @@ export interface HistorySearchParams {
|
|
|
32
32
|
// ---------------------------------------------------------------------------
|
|
33
33
|
|
|
34
34
|
export const getCollectionDocumentHistory = createServerFn({ method: 'GET' })
|
|
35
|
-
.
|
|
35
|
+
.validator((input: { collection: string; id: string; params: HistorySearchParams }) => input)
|
|
36
36
|
.handler(async ({ data }) => {
|
|
37
37
|
const { collection: path, id, params } = data
|
|
38
38
|
const config = await ensureCollection(path)
|
|
@@ -40,7 +40,7 @@ export interface CollectionSearchParams {
|
|
|
40
40
|
// ---------------------------------------------------------------------------
|
|
41
41
|
|
|
42
42
|
export const getCollectionDocuments = createServerFn({ method: 'GET' })
|
|
43
|
-
.
|
|
43
|
+
.validator((input: { collection: string; params: CollectionSearchParams }) => input)
|
|
44
44
|
.handler(async ({ data }) => {
|
|
45
45
|
const { collection: path, params } = data
|
|
46
46
|
const config = await ensureCollection(path)
|
|
@@ -38,7 +38,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
38
38
|
// ---------------------------------------------------------------------------
|
|
39
39
|
|
|
40
40
|
export const reorderCollectionDocument = createServerFn({ method: 'POST' })
|
|
41
|
-
.
|
|
41
|
+
.validator(
|
|
42
42
|
(input: {
|
|
43
43
|
collection: string
|
|
44
44
|
documentId: string
|
|
@@ -20,7 +20,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
|
|
22
22
|
export const restoreDocumentVersion = createServerFn({ method: 'POST' })
|
|
23
|
-
.
|
|
23
|
+
.validator((input: { collection: string; id: string; versionId: string }) => input)
|
|
24
24
|
.handler(async ({ data: input }) => {
|
|
25
25
|
const { collection: path, id, versionId } = input
|
|
26
26
|
const logger = getLogger()
|
|
@@ -25,7 +25,7 @@ export interface CollectionStatusCount {
|
|
|
25
25
|
// ---------------------------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
const getCollectionStatsFn = createServerFn({ method: 'GET' })
|
|
28
|
-
.
|
|
28
|
+
.validator((input: { collection: string }) => input)
|
|
29
29
|
.handler(async ({ data }) => {
|
|
30
30
|
const config = await ensureCollection(data.collection)
|
|
31
31
|
if (!config) return { stats: [] as CollectionStatusCount[] }
|
|
@@ -23,7 +23,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
|
|
25
25
|
export const updateDocumentStatus = createServerFn({ method: 'POST' })
|
|
26
|
-
.
|
|
26
|
+
.validator((input: { collection: string; id: string; status: string }) => input)
|
|
27
27
|
.handler(async ({ data: input }) => {
|
|
28
28
|
const { collection: path, id, status: nextStatus } = input
|
|
29
29
|
const logger = getLogger()
|
|
@@ -64,7 +64,7 @@ export const updateDocumentStatus = createServerFn({ method: 'POST' })
|
|
|
64
64
|
// ---------------------------------------------------------------------------
|
|
65
65
|
|
|
66
66
|
export const unpublishDocument = createServerFn({ method: 'POST' })
|
|
67
|
-
.
|
|
67
|
+
.validator((input: { collection: string; id: string }) => input)
|
|
68
68
|
.handler(async ({ data: input }) => {
|
|
69
69
|
const { collection: path, id } = input
|
|
70
70
|
const logger = getLogger()
|
|
@@ -26,7 +26,7 @@ import { ensureCollection } from '../../integrations/api-utils.js'
|
|
|
26
26
|
// ---------------------------------------------------------------------------
|
|
27
27
|
|
|
28
28
|
export const updateCollectionDocumentWithPatches = createServerFn({ method: 'POST' })
|
|
29
|
-
.
|
|
29
|
+
.validator(
|
|
30
30
|
(input: {
|
|
31
31
|
collection: string
|
|
32
32
|
id: string
|
|
@@ -78,7 +78,7 @@ export const updateCollectionDocumentWithPatches = createServerFn({ method: 'POS
|
|
|
78
78
|
// ---------------------------------------------------------------------------
|
|
79
79
|
|
|
80
80
|
export const updateCollectionDocumentSystemFields = createServerFn({ method: 'POST' })
|
|
81
|
-
.
|
|
81
|
+
.validator(
|
|
82
82
|
(input: {
|
|
83
83
|
collection: string
|
|
84
84
|
id: string
|
|
@@ -147,7 +147,7 @@ function resolveUploadFieldName(
|
|
|
147
147
|
* without depending on TanStack Start server-function transport details.
|
|
148
148
|
*/
|
|
149
149
|
export const uploadCollectionField = createServerFn({ method: 'POST' })
|
|
150
|
-
.
|
|
150
|
+
.validator(parseUploadFormData)
|
|
151
151
|
.handler(async ({ data }) => {
|
|
152
152
|
const { collectionPath, shouldCreateDocument, fieldName, file, fields } = data
|
|
153
153
|
const logger = getLogger()
|
|
@@ -54,7 +54,7 @@ export interface SetInterfaceLocaleResult {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export const setInterfaceLocaleFn = createServerFn({ method: 'POST' })
|
|
57
|
-
.
|
|
57
|
+
.validator((input: SetInterfaceLocaleInput) => input)
|
|
58
58
|
.handler(async ({ data }): Promise<SetInterfaceLocaleResult> => {
|
|
59
59
|
const core = bylineCore()
|
|
60
60
|
const locales = core.config.i18n.interface.locales
|