@naturalcycles/js-lib 14.153.2 → 14.153.3
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/dist/http/fetcher.js
CHANGED
|
@@ -447,9 +447,10 @@ class Fetcher {
|
|
|
447
447
|
method: cfg.method || 'GET',
|
|
448
448
|
headers: cfg.headers || {},
|
|
449
449
|
credentials: cfg.credentials,
|
|
450
|
+
redirect: cfg.redirect,
|
|
450
451
|
},
|
|
451
452
|
hooks: {},
|
|
452
|
-
}, (0, object_util_1._omit)(cfg, ['method', 'credentials', 'headers', 'logger']));
|
|
453
|
+
}, (0, object_util_1._omit)(cfg, ['method', 'credentials', 'headers', 'redirect', 'logger']));
|
|
453
454
|
norm.init.headers = (0, object_util_1._mapKeys)(norm.init.headers, k => k.toLowerCase());
|
|
454
455
|
return norm;
|
|
455
456
|
}
|
|
@@ -480,7 +481,7 @@ class Fetcher {
|
|
|
480
481
|
...this.cfg.init,
|
|
481
482
|
method: opt.method || this.cfg.init.method,
|
|
482
483
|
credentials: opt.credentials || this.cfg.init.credentials,
|
|
483
|
-
redirect: opt.redirect || 'follow',
|
|
484
|
+
redirect: opt.redirect || this.cfg.init.redirect || 'follow',
|
|
484
485
|
}, {
|
|
485
486
|
headers: (0, object_util_1._mapKeys)(opt.headers || {}, k => k.toLowerCase()),
|
|
486
487
|
}),
|
|
@@ -2,7 +2,7 @@ import type { CommonLogger } from '../log/commonLogger';
|
|
|
2
2
|
import type { Promisable } from '../typeFest';
|
|
3
3
|
import type { Reviver, UnixTimestampMillisNumber } from '../types';
|
|
4
4
|
import type { HttpMethod, HttpStatusFamily } from './http.model';
|
|
5
|
-
export interface FetcherNormalizedCfg extends Required<FetcherCfg>, Omit<FetcherRequest, 'started' | 'fullUrl' | 'logRequest' | 'logRequestBody' | 'logResponse' | 'logResponseBody'> {
|
|
5
|
+
export interface FetcherNormalizedCfg extends Required<FetcherCfg>, Omit<FetcherRequest, 'started' | 'fullUrl' | 'logRequest' | 'logRequestBody' | 'logResponse' | 'logResponseBody' | 'redirect' | 'credentials'> {
|
|
6
6
|
logger: CommonLogger;
|
|
7
7
|
searchParams: Record<string, any>;
|
|
8
8
|
}
|
package/dist-esm/http/fetcher.js
CHANGED
|
@@ -437,9 +437,10 @@ export class Fetcher {
|
|
|
437
437
|
method: cfg.method || 'GET',
|
|
438
438
|
headers: cfg.headers || {},
|
|
439
439
|
credentials: cfg.credentials,
|
|
440
|
+
redirect: cfg.redirect,
|
|
440
441
|
},
|
|
441
442
|
hooks: {},
|
|
442
|
-
}, _omit(cfg, ['method', 'credentials', 'headers', 'logger']));
|
|
443
|
+
}, _omit(cfg, ['method', 'credentials', 'headers', 'redirect', 'logger']));
|
|
443
444
|
norm.init.headers = _mapKeys(norm.init.headers, k => k.toLowerCase());
|
|
444
445
|
return norm;
|
|
445
446
|
}
|
|
@@ -456,7 +457,7 @@ export class Fetcher {
|
|
|
456
457
|
'logRequestBody',
|
|
457
458
|
'logResponse',
|
|
458
459
|
'logResponseBody',
|
|
459
|
-
])), { started: Date.now() }), _omit(opt, ['method', 'headers', 'credentials'])), { inputUrl: opt.url || '', fullUrl: opt.url || '', retry: Object.assign(Object.assign({}, this.cfg.retry), _filterUndefinedValues(opt.retry || {})), init: _merge(Object.assign(Object.assign({}, this.cfg.init), { method: opt.method || this.cfg.init.method, credentials: opt.credentials || this.cfg.init.credentials, redirect: opt.redirect || 'follow' }), {
|
|
460
|
+
])), { started: Date.now() }), _omit(opt, ['method', 'headers', 'credentials'])), { inputUrl: opt.url || '', fullUrl: opt.url || '', retry: Object.assign(Object.assign({}, this.cfg.retry), _filterUndefinedValues(opt.retry || {})), init: _merge(Object.assign(Object.assign({}, this.cfg.init), { method: opt.method || this.cfg.init.method, credentials: opt.credentials || this.cfg.init.credentials, redirect: opt.redirect || this.cfg.init.redirect || 'follow' }), {
|
|
460
461
|
headers: _mapKeys(opt.headers || {}, k => k.toLowerCase()),
|
|
461
462
|
}) });
|
|
462
463
|
// setup url
|
package/package.json
CHANGED
|
@@ -7,7 +7,14 @@ export interface FetcherNormalizedCfg
|
|
|
7
7
|
extends Required<FetcherCfg>,
|
|
8
8
|
Omit<
|
|
9
9
|
FetcherRequest,
|
|
10
|
-
|
|
10
|
+
| 'started'
|
|
11
|
+
| 'fullUrl'
|
|
12
|
+
| 'logRequest'
|
|
13
|
+
| 'logRequestBody'
|
|
14
|
+
| 'logResponse'
|
|
15
|
+
| 'logResponseBody'
|
|
16
|
+
| 'redirect'
|
|
17
|
+
| 'credentials'
|
|
11
18
|
> {
|
|
12
19
|
logger: CommonLogger
|
|
13
20
|
searchParams: Record<string, any>
|
package/src/http/fetcher.ts
CHANGED
|
@@ -548,10 +548,11 @@ export class Fetcher {
|
|
|
548
548
|
method: cfg.method || 'GET',
|
|
549
549
|
headers: cfg.headers || {},
|
|
550
550
|
credentials: cfg.credentials,
|
|
551
|
+
redirect: cfg.redirect,
|
|
551
552
|
},
|
|
552
553
|
hooks: {},
|
|
553
554
|
},
|
|
554
|
-
_omit(cfg, ['method', 'credentials', 'headers', 'logger']),
|
|
555
|
+
_omit(cfg, ['method', 'credentials', 'headers', 'redirect', 'logger']),
|
|
555
556
|
)
|
|
556
557
|
|
|
557
558
|
norm.init.headers = _mapKeys(norm.init.headers, k => k.toLowerCase())
|
|
@@ -587,7 +588,7 @@ export class Fetcher {
|
|
|
587
588
|
...this.cfg.init,
|
|
588
589
|
method: opt.method || this.cfg.init.method,
|
|
589
590
|
credentials: opt.credentials || this.cfg.init.credentials,
|
|
590
|
-
redirect: opt.redirect || 'follow',
|
|
591
|
+
redirect: opt.redirect || this.cfg.init.redirect || 'follow',
|
|
591
592
|
},
|
|
592
593
|
{
|
|
593
594
|
headers: _mapKeys(opt.headers || {}, k => k.toLowerCase()),
|