Skip to content

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

Merged
tshemsedinov merged 2 commits intometarhia:masterfrom
stazeworks:master
Sep 20, 2025
Merged

Bus: custom URL params (queries) was added#1957
tshemsedinov merged 2 commits intometarhia:masterfrom
stazeworks:master

Conversation

@stazeworks
Copy link
Copy Markdown
Contributor

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

@tshemsedinov tshemsedinov merged commit eeb4f10 into metarhia:master Sep 20, 2025
1 of 19 checks passed
tshemsedinov added a commit that referenced this pull request Sep 20, 2025
tshemsedinov added a commit that referenced this pull request Sep 20, 2025
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.

2 participants