@mvf/servicer
TypeScript icon, indicating that this package has built-in type declarations

5.7.0 • Public • Published

Servicer package

Usage

To install the package

Run npm install @mvf/servicer

Contributing

Setup

  • Run make to build the container
  • Run make shell to enter the container
  • Run npm install to install dependencies

Refer to package.json for commands

After merging

After you have merged a PR to master, you need to rebuild and publish your changes.

  1. Checkout master git checkout master && git pull
  2. Use one of the following make publish commands to publish changes:
    • make publish kind=patch - Use this if your change is a bug fix and is backwards compatible.
    • make publish kind=minor - Use this if your change adds new functionality and is backwards compatible.
    • make publish kind=major - Use this if your change is not backwards compatible.

Setup Tests

  • In RestEvents, CommandEvents or BackendEvents, add import bindSimulator:
    • import { bindSimulator } from '@mvf/servicer';
  • Then use bindSimulator to create a simulate function:
    • export const simulate = bindSimulator(RestEvents);
  • In the tests it is then possible to call actions using the simulate function: const result = await simulate(ActionConstant, { headers }, { body });

Success response

const result = await simulate(ActionConstant, { headers }, { body });
result.output.output; // will contain response from Action

Error response

Response with Status code & Error message

const err = await catchAsyncError(async () => {
  await simulate(ActionConstant,{headers},{body});
});

expect(err.status).toBe(400);
expect(err.message).toBe('Error message');

Response with type of error

await expect(simulate(ActionConstant, {headers}, {body})).rejects.toThrow(BadRequestError);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.20servicer-v1
5.7.01latest

Version History

VersionDownloads (Last 7 Days)Published
5.7.01
5.6.110
5.6.100
5.6.90
5.6.80
5.6.70
5.6.60
5.6.50
5.6.40
5.6.30
5.6.20
5.6.10
5.6.00
5.5.00
5.4.00
5.3.10
5.3.00
5.2.00
5.1.03
5.0.31
5.0.20
5.0.10
5.0.01
4.0.20
4.0.00
3.1.00
3.0.00
2.2.160
2.2.150
2.2.140
2.2.130
2.2.120
2.2.110
2.2.100
2.2.70
2.2.60
2.2.50
2.2.40
2.2.30
2.2.20
2.2.10
2.2.00
2.1.31
2.1.20
2.1.10
2.1.00
2.0.00
1.3.00
1.2.00
1.0.00

Package Sidebar

Install

npm i @mvf/servicer

Weekly Downloads

7

Version

5.7.0

License

MIT

Unpacked Size

185 kB

Total Files

208

Last publish

Collaborators

  • laleh.koupaei
  • gijserensteinmvf
  • arnicsm
  • russellwind-mvf
  • dovydas.rupsys
  • michaelkingmvf
  • john.felton
  • jrrsmvf