@firecamp/rest-executor
TypeScript icon, indicating that this package has built-in type declarations

1.0.19 • Public • Published

REST-executor

Pre-requisite

  • Node.js v16
  • Pre-script request only contains specific keys, so need to merge with actual one before send to the executor
  • Post-script response only contains specific keys, so need to merge with actual one before going to use

TODO

  • Test cases
    • add graphql body test case
    • chrome agent test cases not running due to chrome API not found
    • Unable to use File, FormData API which prevent run form data body with File

Build

  • Run: pnpm build

Run test case

  • Run: pnpm test

Usage

Execute REST request

// React App
import executor from '@firecamp/rest-executor/dist/esm';

// Node.js
import executor from '@firecamp/rest-executor/dist/cjs';

// Run pre script
const { request, environment } = await executor.preScript(request, variables);

// Run request
const response = await executor.send(request);

// Set cookies

// Run post script
await executor.postScript(postScript: string, response: IRestResponse, variables: TPlainObject);

// Run test script
await executor.testScript(request: IRest, response: IRestResponse, variables: TPlainObject);

Readme

Keywords

none

Package Sidebar

Install

npm i @firecamp/rest-executor

Weekly Downloads

1

Version

1.0.19

License

AGPLV3

Unpacked Size

32.5 kB

Total Files

13

Last publish

Collaborators

  • nishchit14