Actionhero Versions Save

Actionhero is a realtime multi-transport nodejs API Server with integrated cluster capabilities and delayed tasks

v28.1.9

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.8...v28.1.9

v28.1.8

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.7...v28.1.8

v28.1.7

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.6...v28.1.7

v28.1.6

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.5...v28.1.6

v28.1.5

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.4...v28.1.5

v28.1.4

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.3...v28.1.4

v28.1.3

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.2...v28.1.3

v28.1.2

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.1...v28.1.2

v28.1.1

2 years ago

What's Changed

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.1.0...v28.1.1

v28.1.0

2 years ago

What's Changed

Typed Action Params

The new ParamsFrom TS utility can finally help dynamically determine the param types of an Action's run method! This only works on Action classes that statically define the inputs, e.g. NOT in a constructor. Here's a screenshot of things working:

Screen Shot 2021-12-20 at 7 14 01 PM

Note that params.value is properly a string, and we get an error that params.foo is undefined.

Here's the magic:

export type ParamsFrom<A extends Action | Task> = {
  [Input in keyof A["inputs"]]: A["inputs"][Input]["formatter"] extends (
    ...ags: any[]
  ) => any
    ? ReturnType<A["inputs"][Input]["formatter"]>
    : string;
};

What's nice about this approach is that we don't need to change any of Actionhero's internals, but we should start writing all of our Actions and Tasks with static definitions.

Full Changelog: https://github.com/actionhero/actionhero/compare/v28.0.4...v28.1.0