API

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

BodyParser

Ƭ BodyParser: function

Defined in packages/http/src/httpClient.types.ts:23

Type declaration:

▸ (response: RawHttpResponse): HttpResponse‹T›

Parameters:

Name

Type

response

BodyParserImplementation

Ƭ BodyParserImplementation: function

Defined in packages/http/src/bodyParser.ts:6

Type declaration:

▸ (rawResponse: RawHttpResponse): Promise‹any›

Parameters:

Name

Type

rawResponse

BodySerializer

Ƭ BodySerializer: function

Defined in packages/http/src/httpClient.types.ts:25

Type declaration:

▸ (request: HttpOptions): NormalizedHttpBody

Parameters:

Name

Type

request

BufferEncoding

Ƭ BufferEncoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"

Defined in packages/http/src/helpers/encoder.helper.ts:5

ContentTypeMap

Ƭ ContentTypeMap: Record‹keyof typeof ContentTypeRegex, T›

Defined in packages/http/src/contentType.ts:14

HeadersProvider

Ƭ HeadersProvider: function

Defined in packages/http/src/httpClient.ts:27

Type declaration:

▸ (host: string): Promise‹HttpHeaders› | HttpHeaders

Parameters:

Name

Type

host

string

HttpBody

Ƭ HttpBody: object | TypedArray | string

Defined in packages/http/src/httpClient.types.ts:29

HttpFetch

Ƭ HttpFetch: function

Defined in packages/http/src/httpClient.types.ts:27

Type declaration:

▸ (): Promise‹HttpResponse‹Body››

HttpHeaders

Ƭ HttpHeaders: Record‹string, string | number | boolean | undefined | null›

Defined in packages/http/src/httpClient.types.ts:31

HttpInterceptor

Ƭ HttpInterceptor: HttpInterceptorFunction | HttpInterceptorInterface

Defined in packages/http/src/httpClient.types.ts:42

HttpInterceptorFunction

Ƭ HttpInterceptorFunction: function

Defined in packages/http/src/httpClient.types.ts:37

Type declaration:

▸ <Body>(request: HttpFetch‹Body›, options: NormalizedHttpOptions): HttpFetch‹Body›

Type parameters:

Body

Parameters:

Name

Type

request

options

HttpOptions

Ƭ HttpOptions: Partial‹HttpRequestOptions

Defined in packages/http/src/httpClient.types.ts:64

HttpRequestHandler

Ƭ HttpRequestHandler: function

Defined in packages/http/src/httpClient.types.ts:79

Type declaration:

▸ (requestOptions: NormalizedHttpOptions): Promise‹RawHttpResponse

Parameters:

Name

Type

requestOptions

MockHttpRequestHandler

Ƭ MockHttpRequestHandler: HttpRequestHandler & object

Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:36

NormalizedHttpBody

Ƭ NormalizedHttpBody: string | TypedArray | undefined

Defined in packages/http/src/httpClient.types.ts:66

PromiseFunction

Ƭ PromiseFunction: function

Defined in packages/http/src/helpers/parsedBodyCache.helper.ts:1

Type declaration:

▸ (): Promise‹T›

RequestMode

Ƭ RequestMode: "navigate" | "same-origin" | "no-cors" | "cors"

Defined in packages/http/src/httpClient.types.ts:52

Variables

Const DEFAULT_REQUEST_TIMEOUT_MS

DEFAULT_REQUEST_TIMEOUT_MS: number = 5 60 1000

Defined in packages/http/src/httpClient.ts:25

Default request timeout - 5 minutes.

Const DONE

DONE: 4 = 4

Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:7

Const HEADERS_RECEIVED

HEADERS_RECEIVED: 2 = 2

Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:6

TypedArray

TypedArray: any

Defined in packages/http/src/httpClient.types.ts:2

Defined in packages/http/src/helpers/encoder.helper.ts:1

Const symbol

symbol: unique symbol = Symbol('HttpResponseError')

Defined in packages/http/src/httpRequestError.ts:3

Defined in packages/http/src/httpResponseError.ts:4

Functions

Const bodyParser

bodyParser(__namedParameters: object): (Anonymous function)

Defined in packages/http/src/bodyParser.ts:13

Parameters:

Default value __namedParameters: object= {}

Name

Type

bodyCasing

defaultParser

Returns: (Anonymous function)

Const bodySerializer

bodySerializer(__namedParameters: object): BodySerializer

Defined in packages/http/src/bodySerializer.ts:13

Parameters:

Default value __namedParameters: object= {}

Name

Type

bodyCasing

Returns: BodySerializer

Const cacheParsedBody

cacheParsedBody<T>(parsedBody: PromiseFunction‹T›): PromiseFunction‹T›

Defined in packages/http/src/helpers/parsedBodyCache.helper.ts:9

Type parameters:

T

Parameters:

Name

Type

parsedBody

Returns: PromiseFunction‹T›

Const createAsyncBodyHandler

createAsyncBodyHandler<T>(): object

Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:9

Type parameters:

T

Returns: object

  • call(): Promise‹T›

  • onBodyFailure(failer: function): void

  • onBodyReceived(getter: function): void

Const createErrorInterceptor

createErrorInterceptor(): HttpInterceptorFunction

Defined in packages/http/src/interceptors/errorInterceptor.ts:4

Returns: HttpInterceptorFunction

Const createHttpResponse

createHttpResponse(__namedParameters: object): HttpResponse

Defined in packages/http/src/httpResponse.ts:14

Parameters:

__namedParameters: object

Name

Type

Default

body

undefined | string | Uint8Array‹› | Uint8ClampedArray‹› | Uint16Array‹› | Uint32Array‹› | Int8Array‹› | Int16Array‹› | Int32Array‹› | Float32Array‹› | Float64Array‹›

-

headers

undefined | object

-

status

number

-

url

string

""

Returns: HttpResponse

Const createLoggingInterceptor

createLoggingInterceptor(__namedParameters: object): HttpInterceptorFunction

Defined in packages/http/src/interceptors/loggingInterceptor.ts:14

Parameters:

__namedParameters: object

Name

Type

logger

function

Returns: HttpInterceptorFunction

Const createRedirectionInterceptor

createRedirectionInterceptor(__namedParameters: object): HttpInterceptorFunction

Defined in packages/http/src/interceptors/redirectionInterceptor.ts:8

Parameters:

Default value __namedParameters: object= {}

Name

Type

Default

redirectionLimit

number

30

Returns: HttpInterceptorFunction

Const createSimpleServer

createSimpleServer(__namedParameters: object): SimpleServer

Defined in packages/http/src/testing/createSimpleServer.helper.ts:26

Parameters:

__namedParameters: object

Name

Type

endpoints

headers

OutgoingHttpHeaders

status

number

Returns: SimpleServer

Const deepKeyMap

deepKeyMap(object: any, mapper: function): any

Defined in packages/http/src/helpers/caseConversion.helper.ts:15

Parameters:

object: any

mapper: function

▸ (key: string): string

Parameters:

Name

Type

key

string

Returns: any

Const defaultHeaders

defaultHeaders(_host: string): object

Defined in packages/http/src/helpers/httpClient.helper.ts:4

Parameters:

Name

Type

Default

_host

string

""

Returns: object

  • Accept: string = "application/json,application/vnd.api+json"

  • Content-Type: ContentType = ContentType.JSON

Const encodeArrayBuffer

encodeArrayBuffer(data: TypedArray | string | undefined, encoding: BufferEncoding): Uint8Array‹›

Defined in packages/http/src/helpers/encoder.helper.ts:31

Parameters:

Name

Type

Default

data

""

encoding

"utf8"

Returns: Uint8Array‹›

Const encodeText

encodeText(buffer: ArrayBuffer, encoding: string): string

Defined in packages/http/src/helpers/encoder.helper.ts:36

Parameters:

Name

Type

Default

buffer

ArrayBuffer

-

encoding

string

"utf8"

Returns: string

Const fetchRequestHandler

fetchRequestHandler(fetchRequestHandlerOptions: FetchRequestHandlerOptions): HttpRequestHandler

Defined in packages/http/src/requestHandlers/fetch.requestHandler.ts:17

Creates a new HttpRequestHandler that uses Fetch API underneath. Does not support timeout property. Abort is possible only after headers were received.

Parameters:

Name

Type

Default

Description

fetchRequestHandlerOptions

{}

default Fetch API options attached to all requests

Returns: HttpRequestHandler

Const getCaseConverter

getCaseConverter(bodyCasing?: BodyCasing): toCamelCase

Defined in packages/http/src/helpers/caseConversion.helper.ts:51

Parameters:

Name

Type

bodyCasing?

Returns: toCamelCase

Const getEncodingFromHeaders

getEncodingFromHeaders(headers: HttpResponseHeaders | undefined, fallback: string): string

Defined in packages/http/src/helpers/encoder.helper.ts:23

Parameters:

Name

Type

Default

headers

-

fallback

string

"utf8"

Returns: string

Const getHeader

getHeader(headers: HttpHeaders | undefined, header: string): string | undefined

Defined in packages/http/src/helpers/headers.helper.ts:3

Parameters:

Name

Type

headers

header

string

Returns: string | undefined

Const getHostname

getHostname(url: string): string

Defined in packages/http/src/helpers/httpClient.helper.ts:29

Parameters:

Name

Type

url

string

Returns: string

Const handleRequest

handleRequest(code: number, body: any, contentType: string): Promise‹HttpResponse

Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:8

Parameters:

Name

Type

Default

code

number

-

body

any

-

contentType

string

ContentType.TEXT

Returns: Promise‹HttpResponse

Const httpRequestHandler

httpRequestHandler(requestHandlerOptions: HttpRequestHandlerOptions): HttpRequestHandler

Defined in packages/http/src/requestHandlers/http.requestHandler.ts:19

Creates a new HttpRequestHandler that uses native Node.js HTTP & HTTPS modules underneath. Does not support mode property.

Parameters:

Name

Type

Default

Description

requestHandlerOptions

{}

default native options attached to all requests

Returns: HttpRequestHandler

Const isHttpInterceptorInterface

isHttpInterceptorInterface(interceptor: HttpInterceptor): interceptor is HttpInterceptorInterface

Defined in packages/http/src/httpClient.ts:89

Parameters:

Name

Type

interceptor

Returns: interceptor is HttpInterceptorInterface

Const isHttpRequestError

isHttpRequestError(error: any): error is HttpRequestError

Defined in packages/http/src/httpRequestError.ts:14

Parameters:

Name

Type

error

any

Returns: error is HttpRequestError

Const isHttpResponseError

isHttpResponseError(error: any): error is HttpResponseError

Defined in packages/http/src/httpResponseError.ts:17

Parameters:

Name

Type

error

any

Returns: error is HttpResponseError

Const mergeRequestOptions

mergeRequestOptions(defaultRequestOptions: RequestInit | undefined, requestOptions: NormalizedHttpOptions): RequestInit & NormalizedHttpOptions

Defined in packages/http/src/requestHandlers/fetch.requestHandler.ts:62

Parameters:

Name

Type

defaultRequestOptions

RequestInit | undefined

requestOptions

Returns: RequestInit & NormalizedHttpOptions

Const mockRequestHandler

mockRequestHandler(mockOptions: MockOptions): MockHttpRequestHandler

Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:40

Parameters:

Name

Type

mockOptions

Returns: MockHttpRequestHandler

Const noConversion

noConversion(object: any): any

Defined in packages/http/src/helpers/caseConversion.helper.ts:49

Parameters:

Name

Type

object

any

Returns: any

Const parseHeaders

parseHeaders(headers: Headers): Record‹string, string›

Defined in packages/http/src/helpers/headers.helper.ts:12

Parameters:

Name

Type

headers

Headers

Returns: Record‹string, string›

Const passthroughParser

passthroughParser(response: RawHttpResponse): object

Defined in packages/http/src/httpClient.ts:104

Parameters:

Name

Type

response

Returns: object

  • parsedBody: any = (response as any).parsedBody || (() => response.arrayBuffer())

Const sanitizeHeaders

sanitizeHeaders(headers: Record‹string, any›): Record‹string, string›

Defined in packages/http/src/helpers/httpClient.helper.ts:19

Parameters:

Name

Type

headers

Record‹string, any›

Returns: Record‹string, string›

Const sleep

sleep(ms: number): Promise‹unknown›

Defined in packages/http/src/helpers/sleep.helper.ts:1

Parameters:

Name

Type

ms

number

Returns: Promise‹unknown›

Const splitWords

splitWords(text: string): string[]

Defined in packages/http/src/helpers/caseConversion.helper.ts:11

Parameters:

Name

Type

text

string

Returns: string[]

switchContentType

switchContentType<T>(contentType: string, map: ContentTypeMap‹T›, defaultResult: T): T

Defined in packages/http/src/contentType.ts:16

Type parameters:

T

Parameters:

Name

Type

contentType

string

map

defaultResult

T

Returns: T

switchContentType<T>(contentType: string, map: ContentTypeMap‹T›): T | undefined

Defined in packages/http/src/contentType.ts:17

Type parameters:

T

Parameters:

Name

Type

contentType

string

map

Returns: T | undefined

Const toCamelCase

toCamelCase(object: any): any

Defined in packages/http/src/helpers/caseConversion.helper.ts:31

Parameters:

Name

Type

object

any

Returns: any

Const toKebabCase

toKebabCase(object: any): any

Defined in packages/http/src/helpers/caseConversion.helper.ts:45

Parameters:

Name

Type

object

any

Returns: any

Const toPascalCase

toPascalCase(object: any): any

Defined in packages/http/src/helpers/caseConversion.helper.ts:37

Parameters:

Name

Type

object

any

Returns: any

Const toSnakeCase

toSnakeCase(object: any): any

Defined in packages/http/src/helpers/caseConversion.helper.ts:41

Parameters:

Name

Type

object

any

Returns: any

Const toUrlEncoded

toUrlEncoded(obj: object): string

Defined in packages/http/src/helpers/httpClient.helper.ts:9

Parameters:

Name

Type

obj

object

Returns: string

Const urlCombine

urlCombine(sourceUrl: string, sourceQuery?: undefined | object, options?: qs.IStringifyOptions): string

Defined in packages/http/src/helpers/urlEncoding.helper.ts:15

Parameters:

Name

Type

sourceUrl

string

sourceQuery?

undefined | object

options?

qs.IStringifyOptions

Returns: string

Const urlDecode

urlDecode<T>(value: string, options?: qs.IParseOptions): T

Defined in packages/http/src/helpers/urlEncoding.helper.ts:28

Type parameters:

T

Parameters:

Name

Type

value

string

options?

qs.IParseOptions

Returns: T

Const urlDestruct

urlDestruct(url: string, options?: qs.IParseOptions): object

Defined in packages/http/src/helpers/urlEncoding.helper.ts:4

Parameters:

Name

Type

url

string

options?

qs.IParseOptions

Returns: object

  • query: any

  • url: string

Const urlEncode

urlEncode(value: any, options?: qs.IStringifyOptions): string

Defined in packages/http/src/helpers/urlEncoding.helper.ts:24

Parameters:

Name

Type

value

any

options?

qs.IStringifyOptions

Returns: string

Const useInterceptor

useInterceptor(normalizedOptions: NormalizedHttpOptions): (Anonymous function)

Defined in packages/http/src/httpClient.ts:94

Parameters:

Name

Type

normalizedOptions

Returns: (Anonymous function)

Const xhrRequestHandler

xhrRequestHandler(): HttpRequestHandler

Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:51

Returns: HttpRequestHandler

Object literals

Const ContentTypeRegex

ContentTypeRegex: object

Defined in packages/http/src/contentType.ts:8

JSON

JSON: RegExp‹› = /^application\/(json|.++json)$/

Defined in packages/http/src/contentType.ts:10

TEXT

TEXT: RegExp‹› = /^text\//

Defined in packages/http/src/contentType.ts:9

URL_ENCODED

URL_ENCODED: RegExp‹› = /^application\/x-www-form-urlencoded$/

Defined in packages/http/src/contentType.ts:11

Const HttpClientHelper

HttpClientHelper: object

Defined in packages/http/src/helpers/httpClient.helper.ts:34

defaultHeaders

defaultHeaders: defaultHeaders

Defined in packages/http/src/helpers/httpClient.helper.ts:35

getHostname

getHostname: getHostname

Defined in packages/http/src/helpers/httpClient.helper.ts:38

sanitizeHeaders

sanitizeHeaders: sanitizeHeaders

Defined in packages/http/src/helpers/httpClient.helper.ts:37

toUrlEncoded

toUrlEncoded: toUrlEncoded

Defined in packages/http/src/helpers/httpClient.helper.ts:36

Const HttpStatusText

HttpStatusText: object

Defined in packages/http/src/httpCodes.ts:52

__computed

__computed: string = "Network Authentication Required"

Defined in packages/http/src/httpCodes.ts:53

Defined in packages/http/src/httpCodes.ts:54

Defined in packages/http/src/httpCodes.ts:55

Defined in packages/http/src/httpCodes.ts:56

Defined in packages/http/src/httpCodes.ts:57

Defined in packages/http/src/httpCodes.ts:58

Defined in packages/http/src/httpCodes.ts:59

Defined in packages/http/src/httpCodes.ts:60

Defined in packages/http/src/httpCodes.ts:61

Defined in packages/http/src/httpCodes.ts:62

Defined in packages/http/src/httpCodes.ts:63

Defined in packages/http/src/httpCodes.ts:64

Defined in packages/http/src/httpCodes.ts:65

Defined in packages/http/src/httpCodes.ts:66

Defined in packages/http/src/httpCodes.ts:67

Defined in packages/http/src/httpCodes.ts:68

Defined in packages/http/src/httpCodes.ts:69

Defined in packages/http/src/httpCodes.ts:70

Defined in packages/http/src/httpCodes.ts:71

Defined in packages/http/src/httpCodes.ts:72

Defined in packages/http/src/httpCodes.ts:73

Defined in packages/http/src/httpCodes.ts:74

Defined in packages/http/src/httpCodes.ts:75

Defined in packages/http/src/httpCodes.ts:76

Defined in packages/http/src/httpCodes.ts:77

Defined in packages/http/src/httpCodes.ts:78

Defined in packages/http/src/httpCodes.ts:79

Defined in packages/http/src/httpCodes.ts:80

Defined in packages/http/src/httpCodes.ts:81

Defined in packages/http/src/httpCodes.ts:82

Defined in packages/http/src/httpCodes.ts:83

Defined in packages/http/src/httpCodes.ts:84

Defined in packages/http/src/httpCodes.ts:85

Defined in packages/http/src/httpCodes.ts:86

Defined in packages/http/src/httpCodes.ts:87

Defined in packages/http/src/httpCodes.ts:88

Defined in packages/http/src/httpCodes.ts:89

Defined in packages/http/src/httpCodes.ts:90

Defined in packages/http/src/httpCodes.ts:91

Defined in packages/http/src/httpCodes.ts:92

Defined in packages/http/src/httpCodes.ts:93

Defined in packages/http/src/httpCodes.ts:94

Defined in packages/http/src/httpCodes.ts:95

Defined in packages/http/src/httpCodes.ts:96

Defined in packages/http/src/httpCodes.ts:97

Defined in packages/http/src/httpCodes.ts:98

Defined in packages/http/src/httpCodes.ts:99

Defined in packages/http/src/httpCodes.ts:100

Const Interceptors

Interceptors: object

Defined in packages/http/src/interceptors/index.ts:5

createErrorInterceptor

createErrorInterceptor: createErrorInterceptor

Defined in packages/http/src/interceptors/index.ts:6

createLoggingInterceptor

createLoggingInterceptor: createLoggingInterceptor

Defined in packages/http/src/interceptors/index.ts:7

createRedirectionInterceptor

createRedirectionInterceptor: createRedirectionInterceptor

Defined in packages/http/src/interceptors/index.ts:8

Last updated