Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

refactor(schemas): renamed zod schemas files to legacy (#1031)

Corentin Thomasset401efe2fa48c
diff --git a/apps/papra-server/src/modules/admin/organizations/organizations.routes.ts b/apps/papra-server/src/modules/admin/organizations/organizations.routes.ts
index 9274039d..d90eb721 100644
--- a/apps/papra-server/src/modules/admin/organizations/organizations.routes.ts
+++ b/apps/papra-server/src/modules/admin/organizations/organizations.routes.ts
@@ -2,7 +2,7 @@ import type { RouteDefinitionContext } from '../../app/server.types';
import { z } from 'zod';
import { createRoleMiddleware, requireAuthentication } from '../../app/auth/auth.middleware';
import { createIntakeEmailsRepository } from '../../intake-emails/intake-emails.repository';
-import { organizationIdSchema } from '../../organizations/organization.schemas';
+import { organizationIdSchema } from '../../organizations/organization.schemas.legacy';
import { createOrganizationNotFoundError } from '../../organizations/organizations.errors';
import { createOrganizationsRepository } from '../../organizations/organizations.repository';
import { PERMISSIONS } from '../../roles/roles.constants';
diff --git a/apps/papra-server/src/modules/admin/users/users.routes.ts b/apps/papra-server/src/modules/admin/users/users.routes.ts
index dc6028a1..952f58ac 100644
--- a/apps/papra-server/src/modules/admin/users/users.routes.ts
+++ b/apps/papra-server/src/modules/admin/users/users.routes.ts
@@ -6,7 +6,7 @@ import { PERMISSIONS } from '../../roles/roles.constants';
import { createRolesRepository } from '../../roles/roles.repository';
import { legacyValidateParams, legacyValidateQuery } from '../../shared/validation/validation.legacy';
import { createUsersRepository } from '../../users/users.repository';
-import { userIdSchema } from '../../users/users.schemas';
+import { userIdSchema } from '../../users/users.schemas.legacy';
export function registerUserManagementRoutes(context: RouteDefinitionContext) {
registerListUsersRoute(context);
diff --git a/apps/papra-server/src/modules/api-keys/api-keys.routes.ts b/apps/papra-server/src/modules/api-keys/api-keys.routes.ts
index f0e1e746..1d5baa74 100644
--- a/apps/papra-server/src/modules/api-keys/api-keys.routes.ts
+++ b/apps/papra-server/src/modules/api-keys/api-keys.routes.ts
@@ -9,7 +9,7 @@ import { legacyValidateJsonBody, legacyValidateParams } from '../shared/validati
import { API_KEY_PERMISSIONS_VALUES } from './api-keys.constants';
import { createNotApiKeyAuthError } from './api-keys.errors';
import { createApiKeysRepository } from './api-keys.repository';
-import { apiKeyIdSchema } from './api-keys.schemas';
+import { apiKeyIdSchema } from './api-keys.schemas.legacy';
import { createApiKey } from './api-keys.usecases';
export function registerApiKeysRoutes(context: RouteDefinitionContext) {
diff --git a/apps/papra-server/src/modules/api-keys/api-keys.schemas.ts b/apps/papra-server/src/modules/api-keys/api-keys.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/api-keys/api-keys.schemas.ts
rename to apps/papra-server/src/modules/api-keys/api-keys.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/custom-properties/custom-properties.routes.ts b/apps/papra-server/src/modules/custom-properties/custom-properties.routes.ts
index a9f92c97..a8e74c04 100644
--- a/apps/papra-server/src/modules/custom-properties/custom-properties.routes.ts
+++ b/apps/papra-server/src/modules/custom-properties/custom-properties.routes.ts
@@ -5,14 +5,14 @@ import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
import { createDocumentNotFoundError } from '../documents/documents.errors';
import { createDocumentsRepository } from '../documents/documents.repository';
-import { documentIdSchema } from '../documents/documents.schemas';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { documentIdSchema } from '../documents/documents.schemas.legacy';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../organizations/organizations.usecases';
import { legacyValidateJsonBody, legacyValidateParams } from '../shared/validation/validation.legacy';
import { aggregateDocumentCustomPropertyValues } from './custom-properties.models';
import { createCustomPropertiesRepository } from './custom-properties.repository';
-import { customPropertyDefinitionIdSchema } from './custom-properties.schemas';
+import { customPropertyDefinitionIdSchema } from './custom-properties.schemas.legacy';
import { createPropertyDefinition, deleteDocumentCustomPropertyValue, deletePropertyDefinition, ensurePropertyDefinitionExists, setDocumentCustomPropertyValue, updatePropertyDefinition } from './custom-properties.usecases';
import { createPropertyDefinitionBodySchema } from './definitions/custom-property-definition.registry';
import { createCustomPropertiesOptionsRepository } from './options/custom-properties-options.repository';
diff --git a/apps/papra-server/src/modules/custom-properties/custom-properties.schemas.ts b/apps/papra-server/src/modules/custom-properties/custom-properties.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/custom-properties/custom-properties.schemas.ts
rename to apps/papra-server/src/modules/custom-properties/custom-properties.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/custom-properties/definitions/multi-select/multi-select.custom-property-definition.ts b/apps/papra-server/src/modules/custom-properties/definitions/multi-select/multi-select.custom-property-definition.ts
index 2e5a4918..bb56b862 100644
--- a/apps/papra-server/src/modules/custom-properties/definitions/multi-select/multi-select.custom-property-definition.ts
+++ b/apps/papra-server/src/modules/custom-properties/definitions/multi-select/multi-select.custom-property-definition.ts
@@ -1,8 +1,8 @@
import z from 'zod';
-import { customPropertySelectOptionIdSchema } from '../../options/custom-properties-options.schemas';
+import { customPropertySelectOptionIdSchema } from '../../options/custom-properties-options.schemas.legacy';
import { ensureOptionsExist } from '../../options/custom-properties-options.usecases';
import { defineCustomPropertyType } from '../custom-property-definition.models';
-import { selectCustomPropertyOptionNameSchema } from '../select/select.custom-property-definition.schemas';
+import { selectCustomPropertyOptionNameSchema } from '../select/select.custom-property-definition.schemas.legacy';
export const multiSelectCustomPropertyDefinition = defineCustomPropertyType({
typeName: 'multi_select',
diff --git a/apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.schemas.ts b/apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.schemas.ts
rename to apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.ts b/apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.ts
index 116ca35c..b1576f32 100644
--- a/apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.ts
+++ b/apps/papra-server/src/modules/custom-properties/definitions/select/select.custom-property-definition.ts
@@ -1,8 +1,8 @@
import z from 'zod';
-import { customPropertySelectOptionIdSchema } from '../../options/custom-properties-options.schemas';
+import { customPropertySelectOptionIdSchema } from '../../options/custom-properties-options.schemas.legacy';
import { ensureOptionExists } from '../../options/custom-properties-options.usecases';
import { defineCustomPropertyType } from '../custom-property-definition.models';
-import { selectCustomPropertyOptionNameSchema } from './select.custom-property-definition.schemas';
+import { selectCustomPropertyOptionNameSchema } from './select.custom-property-definition.schemas.legacy';
export const selectCustomPropertyDefinition = defineCustomPropertyType({
typeName: 'select',
diff --git a/apps/papra-server/src/modules/custom-properties/options/custom-properties-options.schemas.ts b/apps/papra-server/src/modules/custom-properties/options/custom-properties-options.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/custom-properties/options/custom-properties-options.schemas.ts
rename to apps/papra-server/src/modules/custom-properties/options/custom-properties-options.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/documents/document-activity/document-activity.routes.ts b/apps/papra-server/src/modules/documents/document-activity/document-activity.routes.ts
index 76eb6c61..bfd2cf78 100644
--- a/apps/papra-server/src/modules/documents/document-activity/document-activity.routes.ts
+++ b/apps/papra-server/src/modules/documents/document-activity/document-activity.routes.ts
@@ -2,11 +2,11 @@ import type { RouteDefinitionContext } from '../../app/server.types';
import { z } from 'zod';
import { requireAuthentication } from '../../app/auth/auth.middleware';
import { getUser } from '../../app/auth/auth.models';
-import { organizationIdSchema } from '../../organizations/organization.schemas';
+import { organizationIdSchema } from '../../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../../organizations/organizations.usecases';
import { legacyValidateParams, legacyValidateQuery } from '../../shared/validation/validation.legacy';
-import { documentIdSchema } from '../documents.schemas';
+import { documentIdSchema } from '../documents.schemas.legacy';
import { createDocumentActivityRepository } from './document-activity.repository';
export function registerDocumentActivityRoutes(context: RouteDefinitionContext) {
diff --git a/apps/papra-server/src/modules/documents/documents.config.ts b/apps/papra-server/src/modules/documents/documents.config.ts
index 6bda5b4d..398c9325 100644
--- a/apps/papra-server/src/modules/documents/documents.config.ts
+++ b/apps/papra-server/src/modules/documents/documents.config.ts
@@ -2,7 +2,7 @@ import type { ConfigDefinition } from 'figue';
import * as v from 'valibot';
import { booleanishSchema } from '../config/config.schemas';
import { coercedNumberSchema } from '../shared/schemas/number.schemas';
-import { ocrLanguagesSchema, stringCoercedOcrLanguagesSchema } from './documents.schemas';
+import { ocrLanguagesSchema, stringCoercedOcrLanguagesSchema } from './documents.schemas.legacy';
export const documentsConfig = {
deletedDocumentsRetentionDays: {
diff --git a/apps/papra-server/src/modules/documents/documents.routes.ts b/apps/papra-server/src/modules/documents/documents.routes.ts
index 3642e9fd..c1a1c367 100644
--- a/apps/papra-server/src/modules/documents/documents.routes.ts
+++ b/apps/papra-server/src/modules/documents/documents.routes.ts
@@ -4,7 +4,7 @@ import { z } from 'zod';
import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
import { createCustomPropertiesRepository } from '../custom-properties/custom-properties.repository';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../organizations/organizations.usecases';
import { createPlansRepository } from '../plans/plans.repository';
@@ -17,7 +17,7 @@ import { searchOrganizationDocuments } from './document-search/document-search.u
import { createDocumentIsNotDeletedError } from './documents.errors';
import { formatDocumentForApi, formatDocumentsForApi, isDocumentSizeLimitEnabled } from './documents.models';
import { createDocumentsRepository } from './documents.repository';
-import { documentIdSchema } from './documents.schemas';
+import { documentIdSchema } from './documents.schemas.legacy';
import { createDocumentCreationUsecase, deleteAllTrashDocuments, deleteTrashDocument, enrichAndFormatDocumentForApi, enrichAndFormatDocumentsForApi, ensureDocumentExists, getDocumentOrThrow, restoreDocument, trashDocument, updateDocument } from './documents.usecases';
export function registerDocumentsRoutes(context: RouteDefinitionContext) {
diff --git a/apps/papra-server/src/modules/documents/documents.schemas.ts b/apps/papra-server/src/modules/documents/documents.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/documents/documents.schemas.ts
rename to apps/papra-server/src/modules/documents/documents.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/intake-emails/intake-emails.routes.ts b/apps/papra-server/src/modules/intake-emails/intake-emails.routes.ts
index 5b9e98bc..15a1ed9f 100644
--- a/apps/papra-server/src/modules/intake-emails/intake-emails.routes.ts
+++ b/apps/papra-server/src/modules/intake-emails/intake-emails.routes.ts
@@ -5,7 +5,7 @@ import { createUnauthorizedError } from '../app/auth/auth.errors';
import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
import { createDocumentCreationUsecase } from '../documents/documents.usecases';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../organizations/organizations.usecases';
import { createPlansRepository } from '../plans/plans.repository';
@@ -19,7 +19,7 @@ import { createUsersRepository } from '../users/users.repository';
import { INTAKE_EMAILS_INGEST_ROUTE } from './intake-emails.constants';
import { getRecipientAddresses } from './intake-emails.models';
import { createIntakeEmailsRepository } from './intake-emails.repository';
-import { allowedOriginsSchema, intakeEmailIdSchema, intakeEmailsIngestionMetaSchema, parseJson } from './intake-emails.schemas';
+import { allowedOriginsSchema, intakeEmailIdSchema, intakeEmailsIngestionMetaSchema, parseJson } from './intake-emails.schemas.legacy';
import { createIntakeEmailsServices } from './intake-emails.services';
import { createIntakeEmail, deleteIntakeEmail, processIntakeEmailIngestion } from './intake-emails.usecases';
import { createIntakeEmailUsernameServices } from './username-drivers/intake-email-username.services';
diff --git a/apps/papra-server/src/modules/intake-emails/intake-emails.schemas.ts b/apps/papra-server/src/modules/intake-emails/intake-emails.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/intake-emails/intake-emails.schemas.ts
rename to apps/papra-server/src/modules/intake-emails/intake-emails.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/invitations/invitations.routes.ts b/apps/papra-server/src/modules/invitations/invitations.routes.ts
index ea999a2b..a5803fce 100644
--- a/apps/papra-server/src/modules/invitations/invitations.routes.ts
+++ b/apps/papra-server/src/modules/invitations/invitations.routes.ts
@@ -3,7 +3,7 @@ import z from 'zod';
import { createForbiddenError } from '../app/auth/auth.errors';
import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
-import { invitationIdSchema } from '../organizations/organization.schemas';
+import { invitationIdSchema } from '../organizations/organization.schemas.legacy';
import { ORGANIZATION_INVITATION_STATUS, ORGANIZATION_ROLES } from '../organizations/organizations.constants';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { resendOrganizationInvitation } from '../organizations/organizations.usecases';
diff --git a/apps/papra-server/src/modules/organizations/organization.schemas.ts b/apps/papra-server/src/modules/organizations/organization.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/organizations/organization.schemas.ts
rename to apps/papra-server/src/modules/organizations/organization.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/organizations/organization.schemas.test.ts b/apps/papra-server/src/modules/organizations/organization.schemas.test.ts
index c5da7c57..a594a57d 100644
--- a/apps/papra-server/src/modules/organizations/organization.schemas.test.ts
+++ b/apps/papra-server/src/modules/organizations/organization.schemas.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
-import { organizationIdSchema } from './organization.schemas';
+import { organizationIdSchema } from './organization.schemas.legacy';
describe('organization schemas', () => {
describe('organizationIdSchema', () => {
diff --git a/apps/papra-server/src/modules/organizations/organizations.routes.ts b/apps/papra-server/src/modules/organizations/organizations.routes.ts
index 75a5a7f3..32f22aae 100644
--- a/apps/papra-server/src/modules/organizations/organizations.routes.ts
+++ b/apps/papra-server/src/modules/organizations/organizations.routes.ts
@@ -7,7 +7,7 @@ import { createPlansRepository } from '../plans/plans.repository';
import { legacyValidateJsonBody, legacyValidateParams } from '../shared/validation/validation.legacy';
import { createSubscriptionsRepository } from '../subscriptions/subscriptions.repository';
import { createUsersRepository } from '../users/users.repository';
-import { memberIdSchema, organizationIdSchema } from './organization.schemas';
+import { memberIdSchema, organizationIdSchema } from './organization.schemas.legacy';
import { ORGANIZATION_ROLES } from './organizations.constants';
import { createOrganizationsRepository } from './organizations.repository';
import { checkIfUserCanCreateNewOrganization, createOrganization, ensureUserIsInOrganization, inviteMemberToOrganization, removeMemberFromOrganization, restoreOrganization, softDeleteOrganization, updateOrganizationMemberRole } from './organizations.usecases';
diff --git a/apps/papra-server/src/modules/subscriptions/subscriptions.routes.ts b/apps/papra-server/src/modules/subscriptions/subscriptions.routes.ts
index 4ae114cd..41d837a4 100644
--- a/apps/papra-server/src/modules/subscriptions/subscriptions.routes.ts
+++ b/apps/papra-server/src/modules/subscriptions/subscriptions.routes.ts
@@ -4,7 +4,7 @@ import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
import { createDocumentsRepository } from '../documents/documents.repository';
import { createIntakeEmailsRepository } from '../intake-emails/intake-emails.repository';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationNotFoundError } from '../organizations/organizations.errors';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization, ensureUserIsOwnerOfOrganization, getOrCreateOrganizationCustomerId } from '../organizations/organizations.usecases';
diff --git a/apps/papra-server/src/modules/tagging-rules/tagging-rules.routes.ts b/apps/papra-server/src/modules/tagging-rules/tagging-rules.routes.ts
index fdd7ea8f..a2d3844a 100644
--- a/apps/papra-server/src/modules/tagging-rules/tagging-rules.routes.ts
+++ b/apps/papra-server/src/modules/tagging-rules/tagging-rules.routes.ts
@@ -3,7 +3,7 @@ import type { TaggingRuleField, TaggingRuleOperator } from './tagging-rules.type
import { z } from 'zod';
import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../organizations/organizations.usecases';
import { createError } from '../shared/errors/errors';
@@ -12,7 +12,7 @@ import { legacyValidateJsonBody, legacyValidateParams } from '../shared/validati
import { tagIdRegex } from '../tags/tags.constants';
import { TAGGING_RULE_FIELDS, TAGGING_RULE_OPERATORS } from './tagging-rules.constants';
import { createTaggingRulesRepository } from './tagging-rules.repository';
-import { conditionMatchModeSchema, taggingRuleIdSchema } from './tagging-rules.schemas';
+import { conditionMatchModeSchema, taggingRuleIdSchema } from './tagging-rules.schemas.legacy';
import { createTaggingRule } from './tagging-rules.usecases';
export function registerTaggingRulesRoutes(context: RouteDefinitionContext) {
diff --git a/apps/papra-server/src/modules/tagging-rules/tagging-rules.schemas.ts b/apps/papra-server/src/modules/tagging-rules/tagging-rules.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/tagging-rules/tagging-rules.schemas.ts
rename to apps/papra-server/src/modules/tagging-rules/tagging-rules.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/tags/tags.routes.ts b/apps/papra-server/src/modules/tags/tags.routes.ts
index d6ee902d..1bef723c 100644
--- a/apps/papra-server/src/modules/tags/tags.routes.ts
+++ b/apps/papra-server/src/modules/tags/tags.routes.ts
@@ -7,14 +7,14 @@ import { createDocumentActivityRepository } from '../documents/document-activity
import { deferRegisterDocumentActivityLog } from '../documents/document-activity/document-activity.usecases';
import { createDocumentNotFoundError } from '../documents/documents.errors';
import { createDocumentsRepository } from '../documents/documents.repository';
-import { documentIdSchema } from '../documents/documents.schemas';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { documentIdSchema } from '../documents/documents.schemas.legacy';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../organizations/organizations.usecases';
import { legacyValidateJsonBody, legacyValidateParams } from '../shared/validation/validation.legacy';
import { createTagNotFoundError } from './tags.errors';
import { createTagsRepository } from './tags.repository';
-import { tagColorSchema, tagIdSchema } from './tags.schemas';
+import { tagColorSchema, tagIdSchema } from './tags.schemas.legacy';
import { addTagToDocument, createTag } from './tags.usecases';
export function registerTagsRoutes(context: RouteDefinitionContext) {
diff --git a/apps/papra-server/src/modules/tags/tags.schemas.ts b/apps/papra-server/src/modules/tags/tags.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/tags/tags.schemas.ts
rename to apps/papra-server/src/modules/tags/tags.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/tags/tags.schemas.test.ts b/apps/papra-server/src/modules/tags/tags.schemas.test.ts
index f457dbaa..030e17ad 100644
--- a/apps/papra-server/src/modules/tags/tags.schemas.test.ts
+++ b/apps/papra-server/src/modules/tags/tags.schemas.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
-import { tagColorSchema } from './tags.schemas';
+import { tagColorSchema } from './tags.schemas.legacy';
describe('tags schemas', () => {
describe('tagColorSchema', () => {
diff --git a/apps/papra-server/src/modules/users/users.schemas.ts b/apps/papra-server/src/modules/users/users.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/users/users.schemas.ts
rename to apps/papra-server/src/modules/users/users.schemas.legacy.ts
diff --git a/apps/papra-server/src/modules/webhooks/webhooks.routes.ts b/apps/papra-server/src/modules/webhooks/webhooks.routes.ts
index d035b79a..c5e95e13 100644
--- a/apps/papra-server/src/modules/webhooks/webhooks.routes.ts
+++ b/apps/papra-server/src/modules/webhooks/webhooks.routes.ts
@@ -2,14 +2,14 @@ import type { RouteDefinitionContext } from '../app/server.types';
import { z } from 'zod';
import { requireAuthentication } from '../app/auth/auth.middleware';
import { getUser } from '../app/auth/auth.models';
-import { organizationIdSchema } from '../organizations/organization.schemas';
+import { organizationIdSchema } from '../organizations/organization.schemas.legacy';
import { createOrganizationsRepository } from '../organizations/organizations.repository';
import { ensureUserIsInOrganization } from '../organizations/organizations.usecases';
import { legacyValidateJsonBody, legacyValidateParams } from '../shared/validation/validation.legacy';
import { createWebhookNotFoundError } from './webhooks.errors';
import { formatWebhookForApi } from './webhooks.models';
import { createWebhookRepository } from './webhooks.repository';
-import { webhookEventListSchema, webhookIdSchema, webhookNameSchema, webhookSecretSchema, webhookUrlSchema } from './webhooks.schemas';
+import { webhookEventListSchema, webhookIdSchema, webhookNameSchema, webhookSecretSchema, webhookUrlSchema } from './webhooks.schemas.legacy';
import { createWebhook, updateWebhook } from './webhooks.usecases';
export function registerWebhooksRoutes(context: RouteDefinitionContext) {
diff --git a/apps/papra-server/src/modules/webhooks/webhooks.schemas.ts b/apps/papra-server/src/modules/webhooks/webhooks.schemas.legacy.ts
similarity index 100%
rename from apps/papra-server/src/modules/webhooks/webhooks.schemas.ts
rename to apps/papra-server/src/modules/webhooks/webhooks.schemas.legacy.ts
diff --git a/apps/papra-server/src/scripts/make-user-admin.script.ts b/apps/papra-server/src/scripts/make-user-admin.script.ts
index 4ff0c8ee..c8b1960e 100644
--- a/apps/papra-server/src/scripts/make-user-admin.script.ts
+++ b/apps/papra-server/src/scripts/make-user-admin.script.ts
@@ -1,11 +1,11 @@
import type { UsersRepository } from '../modules/users/users.repository';
import process from 'node:process';
import { z } from 'zod';
-import { permissiveEmailAddressSchema } from '../modules/intake-emails/intake-emails.schemas';
+import { permissiveEmailAddressSchema } from '../modules/intake-emails/intake-emails.schemas.legacy';
import { createRolesRepository } from '../modules/roles/roles.repository';
import { isNil } from '../modules/shared/utils';
import { createUsersRepository } from '../modules/users/users.repository';
-import { userIdSchema } from '../modules/users/users.schemas';
+import { userIdSchema } from '../modules/users/users.schemas.legacy';
import { runScriptWithDb } from './commons/run-script';
const userIdOrEmailSchema = z.union([