Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bus: custom URL params (queries) was added #1957

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stazeworks
Copy link

Bus module update.

Feature:
Added declarative approach to define query parameters for each Bus method with schema validation.
Query parameters can be modified with prefixes and suffixes template in Bus method declaration. (see: test/bus/fakerapi/books.js)

Manually tested.

For fast review via metarhia/Example:

  1. copy
    test/bus/fakerapi/.service.js
    test/bus/fakerapi/books.js
    to metarhia/Example/application/bus/
  2. copy
    lib/bus.js
    to metarhia/Example/node_modules/impress/lib/bus/
  3. Add start hook metarhia/Example/lib/fakerapi/start.js
async () => {
  if (!config.examples.bus) return;
  if (application.worker.id !== 'W1') return;
  const quantity = metarhia.metautil.random(1, 3);
  const res = await bus.fakerapi.books({ quantity });
  console.log('Fetched fake books:', res);
};
  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant