Skip to content

Latest commit

 

History

History
58 lines (54 loc) · 2.69 KB

TODO.md

File metadata and controls

58 lines (54 loc) · 2.69 KB

Todo

  • Support promises in transformMany

  • Dummy data

  • Field transformers

  • created timestamp

  • Relations via type

  • Make config and module code spearate

  • Rename from scam to something else

  • Publish in NPM

  • Sorting in lists via sort param

  • Filtering in lists via any non-reserved field param in query

  • Better normalizeWhereValue

  • PUT/UPDATE

  • DELETE

  • Move selection after insert/update to route handlers

  • Cache in config and schema

  • Allow setting type in singular in schema or use another key for setting reference

  • Make some kind of response formatter for success and error responses

  • Support nested object lists (IDs and/or expanded, singular vs. plural, using select.all)

  • Control nesting level via depth param (have to control circular references somehow)

    • One is enough
  • Add logEndpoints to module

  • Add option for debug mode and print internal error messages as debug field

  • Filter integers and timestamps by operator (<, >, <=, >=)

  • Separate repos for demo and module

  • Validate options upon init

  • Support schema and schema path as option

  • Support data and data path as option

  • Support POSTing multiple resources (insert.many + handlers)

  • Support PUTting multiple resources (update.many + handlers)

  • Support DELETE for multiple resources (delete.many + handlers)

  • updated timestamp

  • Differentiate between PATCH and PUT

  • Report found and not found IDs in deleteToList

  • Make default work in schema

  • Make required work in schema (return errors from POST and UPDATE)

  • Appropriate error codes (returns 500 quite often)

  • Define and document error format

  • Infer type from default if type is omitted in schema

  • Document reserved words (query parameters conflicting with prop names, types conflicting with resource types)

  • Set up test coverage

  • Pagination (limits and offsets)

  • Proper input validation errors

  • Validate schema upon init

  • Validate data upon init (against schema)

  • Default to in-memory db when databasePath is omitted

  • .log() some more information about about data, schema, databasePath and other options

  • Validate all params (sort, nest, filter per field rawType)

  • Support custom hooks and transformers per resource (pass in as options or in schema)

  • update, insert and remove multiple items in SQL at once instead of using the .one methods

  • Author the module as express middleware

  • Move all of these tasks to GitHub issues

Rewrite

Refactor app to have a real scalable structure and less just passing the same arguments to helpers.