micro-action-callers

2.0.1 • Public • Published

Micro Action Callers

Callers to help call micro-action service.

API

requestResponse

async func(url, cmd, input) => fetchResponse

requestBody

async func(url, cmd, input) => body

body is the payload of the http response. Possible fields are:

  • ok - boolean, indicates whether the it is a success or failure response.
  • code - string, used to distinguish response cases
  • output - the payload of this response
  • error - if it is a failure response, it may include an error object which contains information about what's happened to help debug.

requestOkBody

async func(url, cmd, input) => body

Only return if the body.ok=true, otherwise errors will be thrown.

requestOk

async func(url, cmd, input) => output

Call the service and resolve out the output. Only success case will be resolved, otherwise errors will be thrown.

Relative Project

License

ISC

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    0
  • 2.0.0
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i micro-action-callers

Weekly Downloads

0

Version

2.0.1

License

ISC

Last publish

Collaborators

  • zhaoyao91