-
Notifications
You must be signed in to change notification settings - Fork 2
Add a new Datasource
Davide Macchia edited this page Sep 2, 2022
·
10 revisions
- Add a new unique DatasourceCode on descriptor.enum (e.g. THEGUARDIAN = "THEGUARDIAN").
- Create a new folder under src/source (e.g. /src/source/theguardian).
- In the new folder, create a Model (model.theguardian.ts) containing all the interfaces that describes the datasource's information.
- Add the new file to the index.ts under /source/ folder (export * from './theguardian/model.theguardian').
- If the Datasource contains multiple files (e.g Google datasource) add a new Enumeration into descriptor.enum with a RegEx for each file of the new datasource
- Add the new enumeration to the FileCode type
- Add a description for each new FileCode into descriptor.json, skip this step otherwise.
- if the Datasource can be exported, describe the procedure into the descriptor.json.
- Create a new Validator file under the new folder (e.g. /src/source/theguradian/validator.theguardian.ts). The Validator must have a default list of FileCodes, must extends the ValidatorDatasource class and overwrite the functions to let the FileCodes' RegEx match the files' pathnames.
- Update all the functions related functions under Selector.
- Create a new Service file under the new folder (e.g. /src/source/theguradian/service.theguardian.ts).
- The Service must parse each file of the Datasource and map them into a specific interface of the Model, must have a parseFile function.
- Update all the functions related functions under Selector.
- Create a new Processor file under the new folder (e.g. /src/source/theguradian/processor.theguardian.ts).
- Update all the functions related functions under Selector.