Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

feat(content-extraction): hide strategy configs from documentation (#1295)

Corentin Thomassetc4f3a96797d9
diff --git a/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/azure-di/azure-di.content-extraction-strategy.config.ts b/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/azure-di/azure-di.content-extraction-strategy.config.ts
index 9536d9c0..3a4435f0 100644
--- a/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/azure-di/azure-di.content-extraction-strategy.config.ts
+++ b/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/azure-di/azure-di.content-extraction-strategy.config.ts
@@ -9,12 +9,14 @@ export const azureDiConfig = {
env: 'AZURE_DI_ENDPOINT',
schema: v.optional(urlSchema),
default: undefined,
+ showInDocumentation: false,
},
apiKey: {
doc: 'The API key for the Azure Document Intelligence service, will be set as `Ocp-Apim-Subscription-Key` header in requests to the Azure Document Intelligence service.',
env: 'AZURE_DI_API_KEY',
schema: v.string(),
default: '',
+ showInDocumentation: false,
},
mimeTypesAllowList: {
doc: 'The list of mime types that the Azure Document Inteligence strategy will be used for. If the document mime type is not in this list, the strategy will be skipped. Comma separated list. Supports wildcards, e.g. "image/*" matches all image mime types, and "*" matches all formats. Prefix an entry with "!" to negate it, e.g. "*,!image/png" allows everything except PNG. Negations always take precedence over allows, even more specific ones (e.g. "image/png,!image/*" rejects PNG).',
@@ -32,17 +34,20 @@ export const azureDiConfig = {
),
),
default: '*',
+ showInDocumentation: false,
},
pollingAttempts: {
doc: 'The number of attempts to poll the Azure Document Intelligence service for the result of a document processing job.',
env: 'AZURE_DI_POLLING_ATTEMPTS',
schema: coercedStrictlyPositiveIntegerSchema,
default: 10,
+ showInDocumentation: false,
},
pollingDelayMs: {
doc: 'The delay in milliseconds between polling attempts to the Azure Document Intelligence service for the result of a document processing job.',
env: 'AZURE_DI_POLLING_DELAY_MS',
schema: coercedStrictlyPositiveIntegerSchema,
default: 2000,
+ showInDocumentation: false,
},
} as const satisfies AppConfigDefinition;
diff --git a/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/docling/docling.content-extraction-strategy.config.ts b/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/docling/docling.content-extraction-strategy.config.ts
index f7823f88..c3a1fbb5 100644
--- a/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/docling/docling.content-extraction-strategy.config.ts
+++ b/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/docling/docling.content-extraction-strategy.config.ts
@@ -8,12 +8,14 @@ export const doclingConfig = {
env: 'DOCLING_BASE_URL',
schema: urlSchema,
default: 'http://localhost:5001',
+ showInDocumentation: false,
},
apiKey: {
doc: 'The API key for the Docling service, will be set as `X-API-Key` header in requests to the Docling service, can be configured on docling side using the `DOCLING_SERVE_API_KEY` environment variable.',
env: 'DOCLING_API_KEY',
schema: v.optional(v.string()),
default: undefined,
+ showInDocumentation: false,
},
mimeTypesAllowList: {
doc: 'The list of mime types that the Docling strategy will be used for. If the document mime type is not in this list, the strategy will be skipped. Comma separated list. Supports wildcards, e.g. "image/*" matches all image mime types, and "*" matches all formats. Prefix an entry with "!" to negate it, e.g. "*,!image/png" allows everything except PNG. Negations always take precedence over allows, even more specific ones (e.g. "image/png,!image/*" rejects PNG).',
@@ -31,5 +33,6 @@ export const doclingConfig = {
),
),
default: '*',
+ showInDocumentation: false,
},
} as const satisfies AppConfigDefinition;
diff --git a/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/mistral-ocr/mistral-ocr.content-extraction-strategy.config.ts b/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/mistral-ocr/mistral-ocr.content-extraction-strategy.config.ts
index a1c75fe2..e927be0d 100644
--- a/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/mistral-ocr/mistral-ocr.content-extraction-strategy.config.ts
+++ b/apps/papra-server/src/modules/documents/content-extraction/content-extraction-strategies/mistral-ocr/mistral-ocr.content-extraction-strategy.config.ts
@@ -7,6 +7,7 @@ export const mistralOcrConfig = {
env: 'MISTRAL_OCR_MODEL_NAME',
schema: v.string(),
default: 'mistral-ocr-latest',
+ showInDocumentation: false,
},
mimeTypesAllowList: {
doc: 'The list of mime types that the Mistral OCR strategy will be used for. If the document mime type is not in this list, the strategy will be skipped. Comma separated list. Supports wildcards, e.g. "image/*" matches all image mime types, and "*" matches all formats. Prefix an entry with "!" to negate it, e.g. "*,!image/png" allows everything except PNG. Negations always take precedence over allows, even more specific ones (e.g. "image/png,!image/*" rejects PNG).',
@@ -24,5 +25,6 @@ export const mistralOcrConfig = {
),
),
default: 'application/pdf,image/*',
+ showInDocumentation: false,
},
} as const satisfies AppConfigDefinition;