diff --git a/docs/packages/mondo-fetch/assets/highlight.css b/docs/packages/mondo-fetch/assets/highlight.css index 45c14aa22b..c19496b804 100644 --- a/docs/packages/mondo-fetch/assets/highlight.css +++ b/docs/packages/mondo-fetch/assets/highlight.css @@ -1,10 +1,10 @@ :root { - --light-hl-0: #A31515; - --dark-hl-0: #CE9178; - --light-hl-1: #098658; - --dark-hl-1: #B5CEA8; - --light-hl-2: #0000FF; - --dark-hl-2: #569CD6; + --light-hl-0: #0000FF; + --dark-hl-0: #569CD6; + --light-hl-1: #A31515; + --dark-hl-1: #CE9178; + --light-hl-2: #098658; + --dark-hl-2: #B5CEA8; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } diff --git a/docs/packages/mondo-fetch/assets/navigation.js b/docs/packages/mondo-fetch/assets/navigation.js index 0b8b8d5e65..025b491f5a 100644 --- a/docs/packages/mondo-fetch/assets/navigation.js +++ b/docs/packages/mondo-fetch/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA43RSwuCQBQF4P9y15Il9HJXUrSJIIIW0cL01gzZjM0coYj+e/QgteyxPud+HLiLE4EPIJ8CrcAKs2PKlhxKQwjyiVW2s24xqwnsEnJoK1VMfufsPIUhIxIDY7SpRF7iz84ISMcMoeM3oxD92BEkkhXy+ygJreXHintYFhpe0eittMFtbE5IBTbrMGLr5nEZ8Zqt6iGBVmu5qbTeWt/IKe8ztpikkFrZSq9c+R+bSwidoa/jY+7i+ir3Y/FFr3fbjaZ3Xl4A5Dj+gVYCAAA=" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA43QSwuCQBQF4P9y15Il2MNlUrSJIIIW0UL01gzpjDlHSML/HlHkI6XW59yPwz3cCXwDeeRrBVbYFSkbsigNIMgjVnli7Ho2EEhisugiVUTetLQ+wpIRikWW6awTacX9zgpI1wyhoy+jFv3Y4ceSFar7MA6M4feKV9gURk6P4Wt1kudKkgqcnYKwib1aTdJxxzVyy9ecDTYppFam02tW/sf2EkLnmOuoqFw8v2z3Flv6cDYZuU55fAD1Z/rFEQIAAA==" \ No newline at end of file diff --git a/docs/packages/mondo-fetch/assets/search.js b/docs/packages/mondo-fetch/assets/search.js index 5f4cfff87e..3247f41405 100644 --- a/docs/packages/mondo-fetch/assets/search.js +++ b/docs/packages/mondo-fetch/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA61Z23LiRhD9l+FVi5kebuIt69ibpLLBtYuTVKmoFIbBKAYNkUb27lL8e2okgbphBgnwE7Wrc/r09Om5esNi9ZawQbBhL2E0YwMOfY9Fk5VkA3Yv9XRxuwxlpJnH0njJBmy6nCSJTG7Qt+ZCr5bM231iA8a23i5eh8M+3lRFiY7TqVZxZbwGBaPYHltPYpMSTbCU5C1o7zUnqV6oOPwx0aGKRupFRtXSVk6ZgU5mH8LkwzoOXydanpmPij7KxWQ5H86r8yDYd9J/miTyMV5Wi5fAy5Wh1S676VnqWsJ73Pvp1hI9s8uIxlolNUQK1OUqaR2R9CqNmVzKrMQVMnvcxUphMgpXUqX6Lo7rLAhH+HfqjzD5Iv9LZaKHazPfkzqZHDHeKZdpLCdamnHOMnShU2O1dBIvz6xM61ZFWkZ69H0ty/LIKF0lN/jTyY2Ad/fh/r4ffvlcFaexQ9kbjKRkVfnt6/CPSpECdJZGWZdftF5/lnqhZodlQV/qVuVh+HVUEaVRYOzp4mysCp/uKgVyyIXxHx6rB/B4Rfyf736/G91VSexR56gcHHqyJcbW7gdf63p7PwmXcjZSn9Be5A7YoPATKyzK86TuA96fagg/VO5UVcrFApStSMO0lvgx5ZqR70G1xo3RV6g+Ri+ReotMGdNY1lE+YpyrDp2u7cB+q6J5+LzPIIy0jOeTKd07ctDpJj51eKyMaj1FOnaeIuPzz/HVWVQc6C9KyHKQr07EcaKvmwC0/B7vwOEkK44hf4V6oVL9Uc2+71PSpltunLiT1uPOchyR0Igpon5PTctNtmbYBqXYy3iQsENc5yfKusI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qOvbYOlzLZRhJNgjG2+3/ifOgXs8fAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA61ZXXPiNhT9L8qrlqArPgxv3TTZttMtmV3SdsbDdBwQwQ1Y1JaT3WXy3zuSDdZ1JGxInphdnXPP1T1XH1Z2JJXPGRmHO/IYJwsyZhBQkkQbQcbkRqj56modi0QRSvJ0TcZkvo6yTGSX1lhnpTZrQvdDZEzIC93H6zM4xJvLJFNpPlcybYx3gcFWbEq2UapTwglWkqwLvYNmlKuVTOMfkYplMpWPImmWdnKqDFS2+BBnH7Zp/BQpcWI+MvkoVtF6OVk254Gw76R/H2XiLl03i1fA85Wh26u66UGoVsIH3PvpthI9scuQxlZmLURK1PkqeRuR/E0aC7EWpsQNMgfc2Upx9tO9TNV1mrbZDmrod+qNVZR9lIvvzfIV8J2U56mIlJjGG7Ew6C/iv1y0aSI/8fzMqrSuZKJEoqbftyI75CKSfJNd2kNHt3w2OIT7+2by5XNTnIs9yt1KKCWnym9fJ380ipSgkzSquvyi1PazUCu5qJfFGmlbldvJ12lDlIsS407Xzsap8Om6UaCAnBn/9q55AndviP/z9e/X0+smiQPqFJXa9cZsKK52r4229fYmitdiMZWfrFPHH/ACw4/spVaeR3Vv7ZOohfBt45nUpFxuQGZHmuStxF9T3jLzA6jVvG30G1TvksdEPie6jHkq2ii/YpyqDv2B62p+JZNl/HDIIE6USJfRHJ8dBeh4Ex+7JjZGdd4XPSdPmfHpN/bmLBqu7mcl5LiyNyfiubu3TQC6oyHrQ32RTbZ6XtlfsVrJXKGri9LdcunFHbXe7iwcwTVjjGjfU/PqkG0Z9gJT3GWsJewRV/FGSGt3ahCu4G8RbdfKLv0T+rhdKvd2rzSI39dvuqfLHV8zLtEWC6YuPaMkThbiGxnvyJNIs1gmZEygwzsjQskyFuuFftoocqJkLjcbHWhWjv0p9OOCRhSQyy6hYZdy6PQDNpvRcM8wA+Y/DIwRGjIXjCEYEBoChV6HdQMEAwTjhIbcBeMI1iM07FEYdnpDjmA9BOsTGvZdufURbEBoOHBFGyDYkNBw6IINESwgNAxcsADBRoSGIxdshMurq82cPrCaEcYJtxXYC6ZrzsCJxHYwXXbGnUjsCNOVZz0nEpvCdPGZ0xaGfWG6/mzgRGJrmNcbhs1hgc9rhu1hI5+NDBsEXZ+RgP0B48/QNRuorRXjT+BEYn/A+DNyIrE/oE0AZx8B9ge0CeDsI8D+gDYBnH0E2B/QLoCzjwAbBIFvaQM2CEbeHQUbxLvePQUbxLUL4Gxhjg3iZjdztjCv7WfaBXC2MMcGcWOQsz04Noj3fTPn2B9u/HH2Ecf+8KG3RoU95nB5EqkSi1+LQyYM8YGuimN5R/4pT6HDdW1HgIx3L5TAqPjlff37Up1B+l9aVN+a9fFoRelVUXpllMDHNge1lUBQcfnAQ0IP6xWXVVTmZ+rbmDK3MUt1YKnyZm6GZLml6yWbNy99J1ss9aU53b95WXGs4jPwxNk/Wla0UcUqrYKuh7w0X8xKmqdiS9iqOfiE99ziBdgiW/rgm72Z8rz8M0zF7VZUb8oVc15+JVq2WZWH4bEIovhctqhWs4CvtSvqa9OHFt/XbbU6W002KJxivmXxIFRtTfUrsi/dVZTVlxOz14QvzZVS283+ZdDiWvky31KMs0g/ar+qL7O8ZT5z/80k2n2YNUnmm6VM7s0tWy5tqtUJvNywuuWvrzHqnWw5Oizt8VJzxLTWT1AyRx5mue7l/tvU6khr8ty3CjH9ufg4frWHWvsv95leRjI7ksTTAcs76Hn4h89Li2dVkPt4efGGtNy/IVl0+/Dx9du3pUw3qGesyTKn6IySbbwV6zgRZBzOXl7+B+ZZEqMyHgAA"; \ No newline at end of file diff --git a/docs/packages/mondo-fetch/classes/FetchClient.html b/docs/packages/mondo-fetch/classes/FetchClient.html index e65bc7756a..8af8df1bb8 100644 --- a/docs/packages/mondo-fetch/classes/FetchClient.html +++ b/docs/packages/mondo-fetch/classes/FetchClient.html @@ -6,11 +6,11 @@ delete get getUrl -isRequestOptions -isTimeoutError +hasBody +isAbortError post put -

Constructors

Properties

authorizationToken?: string
baseUrl?: string
onBehalfOf?: string

Methods

Constructors

Properties

authorizationToken?: string
baseUrl?: string
onBehalfOf?: string

Methods

Returns error is Error

true or false

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/packages/mondo-fetch/interfaces/AbortError.html b/docs/packages/mondo-fetch/interfaces/AbortError.html deleted file mode 100644 index b6639b3d6e..0000000000 --- a/docs/packages/mondo-fetch/interfaces/AbortError.html +++ /dev/null @@ -1,2 +0,0 @@ -AbortError | @mondopower/fetch

Interface AbortError

interface AbortError {
    name: string;
}

Properties

Properties

name: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/packages/mondo-fetch/interfaces/FetchClientConfig.html b/docs/packages/mondo-fetch/interfaces/FetchClientConfig.html index 1f0d187045..9191cf8ad9 100644 --- a/docs/packages/mondo-fetch/interfaces/FetchClientConfig.html +++ b/docs/packages/mondo-fetch/interfaces/FetchClientConfig.html @@ -1,4 +1,7 @@ FetchClientConfig | @mondopower/fetch

Interface FetchClientConfig

interface FetchClientConfig {
    authorizationToken?: string;
    baseUrl?: string;
    onBehalfOf?: string;
}

Properties

authorizationToken?: string
baseUrl?: string
onBehalfOf?: string

Generated using TypeDoc

\ No newline at end of file +

Properties

authorizationToken?: string

An optional token that will be provided to each request

+
baseUrl?: string

An optional parameter that if provided will be prepended to each request

+
onBehalfOf?: string

An optional user identifier that will be provided to each request

+

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/packages/mondo-fetch/interfaces/RequestOptions.html b/docs/packages/mondo-fetch/interfaces/RequestOptions.html index aa3add5d36..2224da5f72 100644 --- a/docs/packages/mondo-fetch/interfaces/RequestOptions.html +++ b/docs/packages/mondo-fetch/interfaces/RequestOptions.html @@ -1,22 +1,21 @@ -RequestOptions | @mondopower/fetch

Interface RequestOptions

RequestOptions that are optional parameters used for requests

-

Param: contentType

The type of content

-

Default

'application/json; charset=utf-8'
+RequestOptions | @mondopower/fetch

Interface RequestOptions

interface RequestOptions {
    authorizationToken?: string;
    body?: string;
    contentType?: ContentTypes;
    onBehalfOf?: string;
    timeout?: number;
}

Properties

authorizationToken?: string

An optional token that will be provided to each request

+

Default

undefined
 
-

Param: timeout

Optional parameter that dictates how long a request takes in milliseconds before timing out

-

Default

30000
+
body?: string

Optional parameter that contains a payload to send with the request

+

Default

undefined
 
-

Param: authorizationToken

An optional token that will be provided to each request

-

Default

undefined
+
contentType?: ContentTypes

The type of content

+

Default

'application/json; charset=utf-8'
 
-

Param: body

Optional parameter that contains a payload to send with the request

-

Default

undefined
+
onBehalfOf?: string

An optional user identifier that will be provided to each request

+

Default

undefined
 
-

Param: onBehalfOf

An optional user identifier that will be provided to each request

-

Default

undefined
+
timeout?: number

Optional parameter that dictates how long a request takes in milliseconds before timing out

+

Default

30000
 
-
interface RequestOptions {
    authorizationToken?: string;
    body?: string;
    contentType?: ContentTypes;
    onBehalfOf?: string;
    timeout?: number;
}

Properties

authorizationToken?: string
body?: string
contentType?: ContentTypes
onBehalfOf?: string
timeout?: number

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/packages/mondo-fetch/modules.html b/docs/packages/mondo-fetch/modules.html index 6ddca724a3..1c5834141a 100644 --- a/docs/packages/mondo-fetch/modules.html +++ b/docs/packages/mondo-fetch/modules.html @@ -2,8 +2,7 @@ FetchErrorTypes HttpMethods

Classes

Interfaces

Interfaces

Type Aliases

Generated using TypeDoc

\ No newline at end of file diff --git a/packages/mondo-fetch/test/index.spec.ts b/packages/mondo-fetch/test/index.spec.ts index 4c0459e98b..3661692dcb 100644 --- a/packages/mondo-fetch/test/index.spec.ts +++ b/packages/mondo-fetch/test/index.spec.ts @@ -16,8 +16,8 @@ describe('#FetchClient', () => { const client = new FetchClient({authorizationToken: stubToken}) const mock = generateFetchMock(stubData) fetchSpy.mockImplementation(mock) - const expectedHeaders = jsonHeaders - expectedHeaders.set('Authorization', `Bearer ${stubToken}`) + const expectedHeaders = jsonHeaders + expectedHeaders.set('Authorization', `Bearer ${stubToken}`) // act await client.get(url) @@ -33,8 +33,8 @@ describe('#FetchClient', () => { const mock = generateFetchMock(stubData) fetchSpy.mockImplementation(mock) const body = JSON.stringify({data: 'data'}) - const expectedHeaders = jsonHeaders - expectedHeaders.set('X-On-Behalf-Of', onBehalfOf) + const expectedHeaders = jsonHeaders + expectedHeaders.set('X-On-Behalf-Of', onBehalfOf) // act await client.post(url, {body}) @@ -279,7 +279,7 @@ describe('#FetchClient', () => { const mock = jest.fn(() => Promise.reject({ name: 'AbortError', - message: 'stub-error-message' + message: 'stub-error-message', }), ) as jest.Mock fetchSpy.mockImplementation(mock)