OCR
Document recognition gateway for other modules: DSL library functions (extract, extractProfile, summary, raw) that send a file to the OCR service a tenant chooses once, here — the platform's own or an external one.
v0.1.1 · 6 installs · free
What it does
OCR is the one place where a workspace chooses how scanned documents are read. It has no screens, tables or buttons of its own. It gives other modules functions that send a file to a recognition service and return the fields, a summary or the raw text. Which service to use is a single setting here, so the modules that read documents do not each carry an address.
Highlights
- One setting for the service —
platformis the server's own OCR service. Any other value is the base URL of an external service that speaks the same/extractcontract. - Per-folder routing — the setting can differ by folder, so one department's documents can go elsewhere.
- Fields by schema — ask for named fields with a type and a description each.
- Fields by profile — use an extraction profile a module ships and name it in full, such as
proc.bill_of_lading. - Summary and raw text — get a short summary of a general document, or everything read without a schema as a first pass.
- Failures you can store — functions never throw. They return
ok,dataanderror, so an action can mark a record failed instead of rolling back.
Functions
| Function | data on success |
Notes |
|---|---|---|
extract(file, schema) |
{ fields, confidence?, unmatched, raw_text, meta } |
schema is { name: { type, description } } |
extractProfile(file, profile) |
same as extract |
profile must be 'module_cd.profile_cd' |
summary(file) |
{ summary, raw_text, meta } |
For general documents |
raw(file) |
{ raw_text, containers, bl_numbers, invoice_numbers, dates, ... } |
Everything read without a schema |
endpoint() |
the endpoint in use | For display or logging |
Every function except endpoint() returns { ok, data, error }.
execute:
var r = ocr.extractProfile([doc_file], 'proc.bill_of_lading')
if (r.ok) {
[bl_no] = r.data.fields.bl_no
[status] = 'recognized'
} else {
[status] = 'failed'
[error_text] = r.error
}
Profiles are named in full because the function runs as the OCR module and cannot see the caller's short names. A short name is refused. A module lists the functions it needs in its own deps/ocr.json.
Setup
- Install the module.
- Leave
endpointatplatform, or set it to an external service's base URL.
The platform value needs a server with its OCR service configured. Without one, every call returns ok: false with an error saying so.
How it fits
Modules that read documents, such as a procurement or import workspace, call it and keep their own extraction profiles.
Used by
Published modules that build on this one.
- Procurement & ImportImport operations for distributors
Settings
Configurable per workspace, under Admin.
| Setting | Type | Default |
|---|---|---|
endpointOCR service | text | platform |
0.1.1Dec 1, 2026
Code examples in the README are highlighted
For users
The code examples in the module page are now syntax-highlighted.
0.1.0Nov 10, 2026
One OCR setting for every module
Install requirement: admin 1.22.0 or newer, which runs DSL function libraries. The default endpoint,
platform, needs platform 1.28.20 or newer.
For admins
A new OCR module holds the choice of OCR service for the whole workspace. Its one setting, OCR service,
is platform (this server's own service) by default, or the URL of an external service. Every module that
recognizes documents through it picks the setting up. Settings are folder-scoped, so one department can use
a different service than the rest.
For developers
- The module ships no entities: it is a function library,
logic/functions/ocr.dsl. Import what you call indeps/ocr.json("functions": ["extract", "extractProfile", "summary", "raw"]) and call it asocr.<fn>(). extract(file, schema),extractProfile(file, profile),summary(file)andraw(file)return{ ok, data, error }and never throw;datais the service's parsed answer.- An extraction profile is named in full (
'proc.bill_of_lading'): the functions run asocr, so a short name would not find your module's profile. CalldetectDocument()from your own action. - See
files/README.md.
Browse the full
module catalog.
Every module is metadata — install it in one click, then change anything.