dazscript-framework 0.1.16 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dazscript-framework",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "author": "Freddy Diaz",
5
5
  "license": "MPL-2.0",
6
6
  "description": "",
@@ -17,6 +17,7 @@ export interface HttpRequestOptions {
17
17
  path: string
18
18
  method?: HttpMethod
19
19
  connectionMode?: HttpConnectionMode
20
+ timeoutMs?: number
20
21
  responseType?: HttpResponseType
21
22
  queryString?: string
22
23
  headers?: Record<string, string>
@@ -76,6 +77,9 @@ export const request = <T = any>(options: HttpRequestOptions): HttpResponse<T> =
76
77
  const http = options.transport ?? new DzHttpHelper()
77
78
  http.setConnectionMode(options.connectionMode ?? 'https')
78
79
  http.setHost(hostOnly)
80
+ if (typeof http.setTimeoutMs === 'function' && options.timeoutMs && options.timeoutMs > 0) {
81
+ http.setTimeoutMs(options.timeoutMs)
82
+ }
79
83
  if (port > 0) {
80
84
  http.setPort(port)
81
85
  }