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

Readme

Keywords

none

Package Sidebar

Install

npm i micro-action-callers

Weekly Downloads

0

Version

2.0.1

License

ISC

Last publish

Collaborators

  • zhaoyao91