Modules
A module finds bids or companies for a Tommos workspace. You write one function; Tommos runs it, checks it and keeps a log of it.
A module is a small package that finds records of one kind at a source: the open tenders of a public register, the companies in a feed of news. Tommos runs it on the schedule the workspace sets, in a sandbox of its own, and takes only the records that pass the contract of their kind.
| Kind | What a record is | Where it goes in Tommos |
|---|---|---|
bid | An open tender of a public buyer | The door of bids: a deal on the board Bids, after the triage of Tommo Bids |
prospect | A company, by the domain of its website | A card on the board Prospecting |
What you write, and what Tommos does
You write the manifest and the function find. Tommos does the rest:
- It runs
findwhen the schedule of the scout comes, never before. - It gives
findthe cursor of the last good run, and keeps the new cursor only when the run worked. - It checks each record against the contract of its kind, refuses the ones that fail with the reason, and takes the others.
- It keeps one record per source and key: a record that comes again changes the record it is.
- It keeps a log of each run, each record and each line your module writes.
Your module never sees the database. It sees its own secrets and the hosts its manifest names, nothing else.
Quick start
- Fork the reference module on GitHub. Its bid example reads a fictional register, a small file in the repository itself
(
data/fictional-notices.json); no notice in it is real. Its prospect example reads Hacker News. - Install the tools:
npm installandpip install -r requirements.txt. - Run the check:
npx tommos-module check . --entry find.ts. It passes. - Fill the manifest: a name, the kind, the hosts, the secrets.
- Write find in TypeScript or in Python. Use the tools for every call and every record.
- Record an example in
examples/: what the source answered, and the recordsfindgives for it. - Run the check until it passes. Push. The GitHub workflow runs the same check.
- Push a tag, such as
v0.1.0, and give the link to the owner.
A new scout starts in Trial
A module the owner adds is a scout in Trial. Its records go to a trial lane only: no deal, no card. After its first runs, the owner reads its trial report and moves it to Live. Only a person does that.
The repositories
Both are public on GitHub, at the tag v0.2.0.
- TommosCRM/tommos-module-template: the reference module. Fork it.
- TommosCRM/tommos-module-sdk: the tools. A module installs them from GitHub by the tag, as the tools show. npm and PyPI come later.