Feature: hopp-cli in TypeScript (#2074)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
Co-authored-by: liyasthomas <liyascthomas@gmail.com>
Co-authored-by: Gita Alekhya Paul <gitaalekhyapaul@gmail.com>
This commit is contained in:
Deepanshu Dhruw
2022-03-28 13:56:15 +05:30
committed by GitHub
parent cdf61079ae
commit 909d524de5
36 changed files with 2654 additions and 119 deletions

View File

@@ -0,0 +1,36 @@
import { AxiosPromise, AxiosRequestConfig } from "axios";
import { HoppRESTRequest } from "@hoppscotch/data";
/**
* Provides definition to object returned by createRequest.
* @property {function} request Axios request promise, executed to get axios
* response promise.
* @property {string} path Path of request within collection file.
* @property {string} name Name of request within collection
* @property {string} testScript Stringified hoppscotch testScript, used while
* running testRunner.
*/
export interface RequestStack {
request: () => AxiosPromise<any>;
path: string;
}
/**
* Provides definition to axios request promise's request parameter.
* @property {boolean} supported - Boolean check for supported or unsupported requests.
*/
export interface RequestConfig extends AxiosRequestConfig {
supported: boolean;
}
export interface EffectiveHoppRESTRequest extends HoppRESTRequest {
/**
* The effective final URL.
*
* This contains path, params and environment variables all applied to it
*/
effectiveFinalURL: string;
effectiveFinalHeaders: { key: string; value: string; active: boolean }[];
effectiveFinalParams: { key: string; value: string; active: boolean }[];
effectiveFinalBody: FormData | string | null;
}