@equinor/fusion-framework-module-http 6.2.4 → 6.2.5
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/CHANGELOG.md +10 -0
- package/dist/esm/configurator.js +15 -10
- package/dist/esm/configurator.js.map +1 -1
- package/dist/esm/errors.js +5 -3
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/lib/client/client-msal.js +6 -9
- package/dist/esm/lib/client/client-msal.js.map +1 -1
- package/dist/esm/lib/client/client.js +47 -43
- package/dist/esm/lib/client/client.js.map +1 -1
- package/dist/esm/lib/operators/capitalize-request-method.operator.js +2 -3
- package/dist/esm/lib/operators/capitalize-request-method.operator.js.map +1 -1
- package/dist/esm/lib/operators/fetch-request.schema.js +1 -1
- package/dist/esm/lib/operators/fetch-request.schema.js.map +1 -1
- package/dist/esm/lib/operators/process-operators.js +9 -3
- package/dist/esm/lib/operators/process-operators.js.map +1 -1
- package/dist/esm/lib/operators/request-operator-header.js +1 -1
- package/dist/esm/lib/operators/request-operator-header.js.map +1 -1
- package/dist/esm/lib/operators/request-validation.operator.js +1 -1
- package/dist/esm/lib/operators/request-validation.operator.js.map +1 -1
- package/dist/esm/lib/selectors/blob-selector.js +9 -15
- package/dist/esm/lib/selectors/blob-selector.js.map +1 -1
- package/dist/esm/lib/selectors/json-selector.js +3 -12
- package/dist/esm/lib/selectors/json-selector.js.map +1 -1
- package/dist/esm/module.js +7 -16
- package/dist/esm/module.js.map +1 -1
- package/dist/esm/provider.js +2 -1
- package/dist/esm/provider.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/lib/operators/fetch-request.schema.d.ts +3 -3
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -20
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3012](https://github.com/equinor/fusion-framework/pull/3012) [`f53b60b`](https://github.com/equinor/fusion-framework/commit/f53b60b7805706ce7617e614f0ac0c24317a2e43) Thanks [@odinr](https://github.com/odinr)! - removed `typesVersions` from packages, since we no longer support TS < 4.7, also corrected `types` path in package.json
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`f53b60b`](https://github.com/equinor/fusion-framework/commit/f53b60b7805706ce7617e614f0ac0c24317a2e43)]:
|
|
10
|
+
- @equinor/fusion-framework-module@4.3.8
|
|
11
|
+
- @equinor/fusion-framework-module-msal@4.0.3
|
|
12
|
+
|
|
3
13
|
## 6.2.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/esm/configurator.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { capitalizeRequestMethodOperator, requestValidationOperator, HttpRequestHandler, } from './lib/operators';
|
|
2
2
|
/** @inheritdoc */
|
|
3
3
|
export class HttpClientConfigurator {
|
|
4
|
+
_clients = {};
|
|
4
5
|
/** Get a clone of all configured clients */
|
|
5
6
|
get clients() {
|
|
6
|
-
return
|
|
7
|
+
return { ...this._clients };
|
|
7
8
|
}
|
|
9
|
+
/** default class for creation of http clients */
|
|
10
|
+
defaultHttpClientCtor;
|
|
11
|
+
/** default request handler for http clients, applied on creation */
|
|
12
|
+
defaultHttpRequestHandler = new HttpRequestHandler({
|
|
13
|
+
// convert all request methods to uppercase
|
|
14
|
+
'capitalize-method': capitalizeRequestMethodOperator(),
|
|
15
|
+
// validate the request object
|
|
16
|
+
'request-validation': requestValidationOperator(),
|
|
17
|
+
});
|
|
8
18
|
/**
|
|
9
19
|
* Create a instance of http configuration
|
|
10
20
|
* @param client defaultHttpRequestHandler
|
|
11
21
|
*/
|
|
12
22
|
constructor(client) {
|
|
13
|
-
this._clients = {};
|
|
14
|
-
/** default request handler for http clients, applied on creation */
|
|
15
|
-
this.defaultHttpRequestHandler = new HttpRequestHandler({
|
|
16
|
-
// convert all request methods to uppercase
|
|
17
|
-
'capitalize-method': capitalizeRequestMethodOperator(),
|
|
18
|
-
// validate the request object
|
|
19
|
-
'request-validation': requestValidationOperator(),
|
|
20
|
-
});
|
|
21
23
|
this.defaultHttpClientCtor = client;
|
|
22
24
|
}
|
|
23
25
|
/** @inheritdoc */
|
|
@@ -28,7 +30,10 @@ export class HttpClientConfigurator {
|
|
|
28
30
|
configureClient(name, args) {
|
|
29
31
|
const argFn = typeof args === 'string' ? { baseUri: args } : args;
|
|
30
32
|
const options = typeof argFn === 'function' ? { onCreate: argFn } : argFn;
|
|
31
|
-
this._clients[name] =
|
|
33
|
+
this._clients[name] = {
|
|
34
|
+
...this._clients[name],
|
|
35
|
+
...options,
|
|
36
|
+
};
|
|
32
37
|
return this;
|
|
33
38
|
}
|
|
34
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurator.js","sourceRoot":"","sources":["../../src/configurator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAwHzB,kBAAkB;AAClB,MAAM,OAAO,sBAAsB;
|
|
1
|
+
{"version":3,"file":"configurator.js","sourceRoot":"","sources":["../../src/configurator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAwHzB,kBAAkB;AAClB,MAAM,OAAO,sBAAsB;IAGvB,QAAQ,GAA+C,EAAE,CAAC;IAEpE,4CAA4C;IAC5C,IAAW,OAAO;QAChB,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAED,iDAAiD;IACxC,qBAAqB,CAAiC;IAE/D,oEAAoE;IAC3D,yBAAyB,GAAG,IAAI,kBAAkB,CAAqC;QAC9F,2CAA2C;QAC3C,mBAAmB,EAAE,+BAA+B,EAAE;QACtD,8BAA8B;QAC9B,oBAAoB,EAAE,yBAAyB,EAAE;KAClD,CAAC,CAAC;IAEH;;;OAGG;IACH,YAAY,MAAsC;QAChD,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IACtC,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,IAAY;QACpB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,kBAAkB;IAClB,eAAe,CACb,IAAY,EACZ,IAAsE;QAEtE,MAAM,KAAK,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,EAAE,OAAO,EAAE,IAAI,EAA2B,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5F,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG;YACpB,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YACtB,GAAI,OAAiD;SACtD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,eAAe,sBAAsB,CAAC"}
|
package/dist/esm/errors.js
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* @template TResponse The type of the HTTP response.
|
|
4
4
|
*/
|
|
5
5
|
export class HttpResponseError extends Error {
|
|
6
|
+
response;
|
|
7
|
+
static Name = 'HttpResponseError';
|
|
6
8
|
constructor(message, response, options) {
|
|
7
9
|
super(message, options);
|
|
8
10
|
this.response = response;
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
HttpResponseError.Name = 'HttpResponseError';
|
|
12
13
|
/**
|
|
13
14
|
* Represents an error that occurs when handling a JSON response in an HTTP request.
|
|
14
15
|
* Extends the base `HttpResponseError` class.
|
|
@@ -17,6 +18,8 @@ HttpResponseError.Name = 'HttpResponseError';
|
|
|
17
18
|
* @template TResponse - The type of the HTTP response.
|
|
18
19
|
*/
|
|
19
20
|
export class HttpJsonResponseError extends HttpResponseError {
|
|
21
|
+
static Name = 'HttpJsonResponseError';
|
|
22
|
+
data;
|
|
20
23
|
/**
|
|
21
24
|
* Creates a new instance of `HttpJsonResponseError`.
|
|
22
25
|
*
|
|
@@ -27,8 +30,7 @@ export class HttpJsonResponseError extends HttpResponseError {
|
|
|
27
30
|
constructor(message, response, options) {
|
|
28
31
|
super(message, response, options);
|
|
29
32
|
this.name = HttpJsonResponseError.Name;
|
|
30
|
-
this.data = options
|
|
33
|
+
this.data = options?.data;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
|
-
HttpJsonResponseError.Name = 'HttpJsonResponseError';
|
|
34
36
|
//# sourceMappingURL=errors.js.map
|
package/dist/esm/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,iBAAwC,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,iBAAwC,SAAQ,KAAK;IAI9C;IAHlB,MAAM,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,YACE,OAAe,EACC,QAAmB,EACnC,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAHR,aAAQ,GAAR,QAAQ,CAAW;IAIrC,CAAC;;AAGH;;;;;;GAMG;AACH,MAAM,OAAO,qBAGX,SAAQ,iBAA4B;IACpC,MAAM,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtB,IAAI,CAAS;IAE7B;;;;;;OAMG;IACH,YAAY,OAAe,EAAE,QAAmB,EAAE,OAAyC;QACzF,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,CAAC;IAC5B,CAAC"}
|
|
@@ -14,14 +14,11 @@ import { HttpClient } from './client';
|
|
|
14
14
|
* @template TResponse - The type of the response object. Defaults to `FetchResponse`.
|
|
15
15
|
*/
|
|
16
16
|
export class HttpClientMsal extends HttpClient {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
this.defaultScopes = [];
|
|
24
|
-
}
|
|
17
|
+
/**
|
|
18
|
+
* An array of default scopes to be used for all requests, unless overridden in the request object.
|
|
19
|
+
* This property is used by the `HttpClientMsal` class to add MSAL authentication support to requests.
|
|
20
|
+
*/
|
|
21
|
+
defaultScopes = [];
|
|
25
22
|
/**
|
|
26
23
|
* Fetches a resource from the specified path, with optional MSAL authentication scopes.
|
|
27
24
|
*
|
|
@@ -41,7 +38,7 @@ export class HttpClientMsal extends HttpClient {
|
|
|
41
38
|
* This ensures that the request includes the necessary scopes for MSAL authentication.
|
|
42
39
|
*/
|
|
43
40
|
const args = Object.assign(init || {}, {
|
|
44
|
-
scopes: this.defaultScopes.concat(
|
|
41
|
+
scopes: this.defaultScopes.concat(init?.scopes || []),
|
|
45
42
|
});
|
|
46
43
|
return super._fetch$(path, args);
|
|
47
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-msal.js","sourceRoot":"","sources":["../../../../src/lib/client/client-msal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsBtC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAGX,SAAQ,UAA+B;
|
|
1
|
+
{"version":3,"file":"client-msal.js","sourceRoot":"","sources":["../../../../src/lib/client/client-msal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsBtC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAGX,SAAQ,UAA+B;IACvC;;;OAGG;IACI,aAAa,GAAa,EAAE,CAAC;IAEpC;;;;;;;;;;;;OAYG;IACI,MAAM,CACX,IAAY,EACZ,IAAmD;QAEnD;;;WAGG;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE;YACrC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,CAAC;SACtD,CAA6C,CAAC;QAE/C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { firstValueFrom, of, Subject } from 'rxjs';
|
|
13
2
|
import { switchMap, takeUntil, tap } from 'rxjs/operators';
|
|
14
3
|
import { fromFetch } from 'rxjs/fetch';
|
|
@@ -17,6 +6,32 @@ import { blobSelector, jsonSelector } from '../selectors';
|
|
|
17
6
|
import { HttpResponseError } from '../../errors';
|
|
18
7
|
/** Base http client for executing requests */
|
|
19
8
|
export class HttpClient {
|
|
9
|
+
uri;
|
|
10
|
+
/**
|
|
11
|
+
* A request handler that can be used to customize the request before it is sent.
|
|
12
|
+
* This property is part of the `HttpClientCreateOptions` configuration object used to create an `HttpClient` instance.
|
|
13
|
+
*/
|
|
14
|
+
requestHandler;
|
|
15
|
+
/**
|
|
16
|
+
* A handler for customizing the response after it is received.
|
|
17
|
+
* This property is part of the `HttpClientCreateOptions` configuration object used to create an `HttpClient` instance.
|
|
18
|
+
*/
|
|
19
|
+
responseHandler;
|
|
20
|
+
/**
|
|
21
|
+
* A stream of requests that are about to be executed.
|
|
22
|
+
* This property is used internally by the `HttpClient` class to manage the lifecycle of requests.
|
|
23
|
+
*/
|
|
24
|
+
_request$ = new Subject();
|
|
25
|
+
/**
|
|
26
|
+
* A stream of responses that have been received.
|
|
27
|
+
* This property is used internally by the `HttpClient` class to manage the lifecycle of responses.
|
|
28
|
+
*/
|
|
29
|
+
_response$ = new Subject();
|
|
30
|
+
/**
|
|
31
|
+
* A stream that is used to signal the abortion of requests.
|
|
32
|
+
* This property is used internally by the `HttpClient` class to manage the lifecycle of requests.
|
|
33
|
+
*/
|
|
34
|
+
_abort$ = new Subject();
|
|
20
35
|
/**
|
|
21
36
|
* A stream of requests that are about to be executed.
|
|
22
37
|
*/
|
|
@@ -31,23 +46,8 @@ export class HttpClient {
|
|
|
31
46
|
}
|
|
32
47
|
constructor(uri, options) {
|
|
33
48
|
this.uri = uri;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* This property is used internally by the `HttpClient` class to manage the lifecycle of requests.
|
|
37
|
-
*/
|
|
38
|
-
this._request$ = new Subject();
|
|
39
|
-
/**
|
|
40
|
-
* A stream of responses that have been received.
|
|
41
|
-
* This property is used internally by the `HttpClient` class to manage the lifecycle of responses.
|
|
42
|
-
*/
|
|
43
|
-
this._response$ = new Subject();
|
|
44
|
-
/**
|
|
45
|
-
* A stream that is used to signal the abortion of requests.
|
|
46
|
-
* This property is used internally by the `HttpClient` class to manage the lifecycle of requests.
|
|
47
|
-
*/
|
|
48
|
-
this._abort$ = new Subject();
|
|
49
|
-
this.requestHandler = new HttpRequestHandler(options === null || options === void 0 ? void 0 : options.requestHandler);
|
|
50
|
-
this.responseHandler = new HttpResponseHandler(options === null || options === void 0 ? void 0 : options.responseHandler);
|
|
49
|
+
this.requestHandler = new HttpRequestHandler(options?.requestHandler);
|
|
50
|
+
this.responseHandler = new HttpResponseHandler(options?.responseHandler);
|
|
51
51
|
this._init();
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -94,15 +94,17 @@ export class HttpClient {
|
|
|
94
94
|
* @returns A stream response containing the fetched data in JSON format.
|
|
95
95
|
*/
|
|
96
96
|
json$(path, args) {
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const headers = new Headers(args === null || args === void 0 ? void 0 : args.headers);
|
|
97
|
+
const body = typeof args?.body === 'object' ? JSON.stringify(args?.body) : args?.body;
|
|
98
|
+
const selector = args?.selector ?? jsonSelector;
|
|
99
|
+
const headers = new Headers(args?.headers);
|
|
101
100
|
headers.append('Accept', 'application/json');
|
|
102
101
|
headers.append('Content-Type', 'application/json');
|
|
103
|
-
return this.fetch$(path,
|
|
102
|
+
return this.fetch$(path, {
|
|
103
|
+
...args,
|
|
104
|
+
body,
|
|
104
105
|
selector,
|
|
105
|
-
headers
|
|
106
|
+
headers,
|
|
107
|
+
});
|
|
106
108
|
}
|
|
107
109
|
/**
|
|
108
110
|
* Fetches data from the specified path and returns a Promise containing the fetched data in JSON format.
|
|
@@ -125,11 +127,13 @@ export class HttpClient {
|
|
|
125
127
|
* @returns A stream response containing the fetched blob data.
|
|
126
128
|
*/
|
|
127
129
|
blob$(path, args) {
|
|
128
|
-
var _a;
|
|
129
130
|
// Get the selector value from the provided args, or use the default blobSelector
|
|
130
|
-
const selector =
|
|
131
|
+
const selector = args?.selector ?? blobSelector;
|
|
131
132
|
// Create the FetchRequestInit object with the provided args and the selector
|
|
132
|
-
const init =
|
|
133
|
+
const init = {
|
|
134
|
+
...args,
|
|
135
|
+
selector,
|
|
136
|
+
};
|
|
133
137
|
// Call the fetch$ method with the provided path and the constructed init object
|
|
134
138
|
return this.fetch$(path, init);
|
|
135
139
|
}
|
|
@@ -182,17 +186,17 @@ export class HttpClient {
|
|
|
182
186
|
* 6. Cancels the request if the `_abort$` observable emits.
|
|
183
187
|
*/
|
|
184
188
|
_fetch$(path, args) {
|
|
185
|
-
const
|
|
186
|
-
const response$ = of(
|
|
189
|
+
const { selector, ...options } = args || {};
|
|
190
|
+
const response$ = of({
|
|
191
|
+
...options,
|
|
192
|
+
uri: this._resolveUrl(path),
|
|
193
|
+
}).pipe(
|
|
187
194
|
/** prepare request, allow extensions to modify request */
|
|
188
195
|
switchMap((x) => this._prepareRequest(x)),
|
|
189
196
|
/** push request to event buss */
|
|
190
197
|
tap((x) => this._request$.next(x)),
|
|
191
198
|
/** execute request */
|
|
192
|
-
switchMap((
|
|
193
|
-
var { uri, path: _path } = _a, init = __rest(_a, ["uri", "path"]);
|
|
194
|
-
return fromFetch(uri, init);
|
|
195
|
-
}),
|
|
199
|
+
switchMap(({ uri, path: _path, ...init }) => fromFetch(uri, init)),
|
|
196
200
|
/** prepare response, allow extensions to modify response */
|
|
197
201
|
switchMap((x) => this._prepareResponse(x)),
|
|
198
202
|
/** push response to event buss */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/client/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,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AO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QACpE,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -6,10 +6,9 @@ import { requestMethodCasing } from './fetch-request.schema';
|
|
|
6
6
|
* @returns A new request object with the HTTP method in uppercase.
|
|
7
7
|
*/
|
|
8
8
|
export const capitalizeRequestMethodOperator = (options) => (request) => {
|
|
9
|
-
var _a;
|
|
10
9
|
const { error, success, data } = requestMethodCasing().safeParse(request.method);
|
|
11
|
-
request.method = success ? data :
|
|
12
|
-
if (error && !
|
|
10
|
+
request.method = success ? data : request.method?.toUpperCase();
|
|
11
|
+
if (error && !options?.silent) {
|
|
13
12
|
for (const e of error.errors) {
|
|
14
13
|
console.warn(e.message);
|
|
15
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capitalize-request-method.operator.js","sourceRoot":"","sources":["../../../../src/lib/operators/capitalize-request-method.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,CAAwB,OAA8B,EAAsB,EAAE,CAC9E,CAAC,OAAO,EAAK,EAAE
|
|
1
|
+
{"version":3,"file":"capitalize-request-method.operator.js","sourceRoot":"","sources":["../../../../src/lib/operators/capitalize-request-method.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,CAAwB,OAA8B,EAAsB,EAAE,CAC9E,CAAC,OAAO,EAAK,EAAE;IACb,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,mBAAmB,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjF,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;IAEhE,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAC9B,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
* @link https://www.rfc-editor.org/rfc/rfc7231#section-4.1
|
|
6
6
|
*/
|
|
7
7
|
export const requestMethodCasing = () => {
|
|
8
|
-
return z.custom((value) => value ===
|
|
8
|
+
return z.custom((value) => value === value?.toUpperCase(), (value) => ({
|
|
9
9
|
code: z.ZodIssueCode.custom,
|
|
10
10
|
validation: 'uppercase',
|
|
11
11
|
path: ['method'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-request.schema.js","sourceRoot":"","sources":["../../../../src/lib/operators/fetch-request.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAsB,EAAE;IACzD,OAAO,CAAC,CAAC,MAAM,CACb,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"fetch-request.schema.js","sourceRoot":"","sources":["../../../../src/lib/operators/fetch-request.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAsB,EAAE;IACzD,OAAO,CAAC,CAAC,MAAM,CACb,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,KAAK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C,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,cAAc,EAAE,CAAC;SACd,IAAI,CAAC;QACJ,aAAa;QACb,4BAA4B;QAC5B,QAAQ;QACR,0BAA0B;QAC1B,aAAa;QACb,eAAe;QACf,iCAAiC;QACjC,YAAY;KACb,CAAC;SACD,QAAQ,EAAE;IACb,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACzD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
|
|
@@ -8,6 +8,12 @@ import { last, mergeScan } from 'rxjs/operators';
|
|
|
8
8
|
* @template T The type of data that the process operators work with
|
|
9
9
|
*/
|
|
10
10
|
export class ProcessOperators {
|
|
11
|
+
/**
|
|
12
|
+
* A record of process operators keyed by a string.
|
|
13
|
+
* This property is used to store and manage the collection of process operators
|
|
14
|
+
* that are used by the `ProcessOperators` class.
|
|
15
|
+
*/
|
|
16
|
+
_operators;
|
|
11
17
|
/**
|
|
12
18
|
* Accessor for the collection of process operators.
|
|
13
19
|
* @returns The record of process operators.
|
|
@@ -22,10 +28,10 @@ export class ProcessOperators {
|
|
|
22
28
|
*/
|
|
23
29
|
constructor(operators) {
|
|
24
30
|
if (operators && 'operators' in operators) {
|
|
25
|
-
this._operators =
|
|
31
|
+
this._operators = { ...operators.operators };
|
|
26
32
|
}
|
|
27
33
|
else {
|
|
28
|
-
this._operators = operators
|
|
34
|
+
this._operators = operators ?? {};
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
@@ -81,7 +87,7 @@ export class ProcessOperators {
|
|
|
81
87
|
}
|
|
82
88
|
return from(Object.values(this._operators)).pipe(mergeScan(
|
|
83
89
|
// resolve current operator and return result or previous if void
|
|
84
|
-
(value, operator) => Promise.resolve(operator(value)).then((x) => x
|
|
90
|
+
(value, operator) => Promise.resolve(operator(value)).then((x) => x ?? value),
|
|
85
91
|
// initial value
|
|
86
92
|
request,
|
|
87
93
|
// only allow concurrency of one operator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-operators.js","sourceRoot":"","sources":["../../../../src/lib/operators/process-operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;
|
|
1
|
+
{"version":3,"file":"process-operators.js","sourceRoot":"","sources":["../../../../src/lib/operators/process-operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;;OAIG;IACO,UAAU,CAAqC;IAEzD;;;OAGG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,YAAY,SAAqE;QAC/E,IAAI,SAAS,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;YAC1C,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QAC/C,CAAC;aAAM,CAAC;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E,CAAC,CAAC,IAAI,KAAK,CAAC;QAC7E,gBAAgB;QAChB,OAAO;QACP,yCAAyC;QACzC,CAAC,CACF;QACD,iCAAiC;QACjC,IAAI,EAAE,CACP,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export const requestOperatorHeader = (key, value) => (request) => {
|
|
9
9
|
const headers = new Headers(request.headers);
|
|
10
10
|
headers.append(key, value);
|
|
11
|
-
return
|
|
11
|
+
return { ...request, headers };
|
|
12
12
|
};
|
|
13
13
|
export default requestOperatorHeader;
|
|
14
14
|
//# sourceMappingURL=request-operator-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-operator-header.js","sourceRoot":"","sources":["../../../../src/lib/operators/request-operator-header.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,CAAwC,GAAW,EAAE,KAAa,EAAsB,EAAE,CAC1F,CAAC,OAAO,EAAE,EAAE;IACV,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"request-operator-header.js","sourceRoot":"","sources":["../../../../src/lib/operators/request-operator-header.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,CAAwC,GAAW,EAAE,KAAa,EAAsB,EAAE,CAC1F,CAAC,OAAO,EAAE,EAAE;IACV,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3B,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AACjC,CAAC,CAAC;AAEJ,eAAe,qBAAqB,CAAC"}
|
|
@@ -13,7 +13,7 @@ import { fetchRequestSchema } from './fetch-request.schema';
|
|
|
13
13
|
* @throws Will log an error message if the request validation fails.
|
|
14
14
|
*/
|
|
15
15
|
export const requestValidationOperator = (options) => (request) => {
|
|
16
|
-
const { strict, parse } = options
|
|
16
|
+
const { strict, parse } = options ?? {};
|
|
17
17
|
const schema = strict ? fetchRequestSchema : fetchRequestSchema.passthrough();
|
|
18
18
|
try {
|
|
19
19
|
const result = schema.parse(request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-validation.operator.js","sourceRoot":"","sources":["../../../../src/lib/operators/request-validation.operator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,CAAyB,OAiBxB,EAAsB,EAAE,CACzB,CAAC,OAAO,EAAE,EAAE;IACV,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"request-validation.operator.js","sourceRoot":"","sources":["../../../../src/lib/operators/request-validation.operator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,CAAyB,OAiBxB,EAAsB,EAAE,CACzB,CAAC,OAAO,EAAE,EAAE;IACV,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,EAAE,CAAC;IAC9E,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAM,CAAC;QAC1C,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAG,KAAoB,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
/**
|
|
11
2
|
* Extracts a blob and filename from a successful HTTP response.
|
|
12
3
|
*
|
|
@@ -14,8 +5,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
5
|
* @returns A promise that resolves to an object containing the extracted blob and filename.
|
|
15
6
|
* @throws {Error} If the response is not successful or if there is an error parsing the response.
|
|
16
7
|
*/
|
|
17
|
-
export const blobSelector = (response) =>
|
|
18
|
-
var _a, _b, _c;
|
|
8
|
+
export const blobSelector = async (response) => {
|
|
19
9
|
if (!response.ok) {
|
|
20
10
|
// Throw an error if the network response is not successful
|
|
21
11
|
throw new Error('network response was not OK');
|
|
@@ -25,17 +15,21 @@ export const blobSelector = (response) => __awaiter(void 0, void 0, void 0, func
|
|
|
25
15
|
throw new Error('no content');
|
|
26
16
|
}
|
|
27
17
|
// Extract the filename from the 'content-disposition' header
|
|
28
|
-
const filename =
|
|
29
|
-
.get('content-disposition')
|
|
18
|
+
const filename = response.headers
|
|
19
|
+
.get('content-disposition')
|
|
20
|
+
?.split(';')
|
|
21
|
+
.find((n) => n.includes('filename='))
|
|
22
|
+
?.replace('filename=', '')
|
|
23
|
+
?.trim();
|
|
30
24
|
try {
|
|
31
25
|
// Convert the response to a Blob and return the filename and Blob
|
|
32
|
-
const blob =
|
|
26
|
+
const blob = await response.blob();
|
|
33
27
|
return { filename, blob };
|
|
34
28
|
}
|
|
35
29
|
catch (err) {
|
|
36
30
|
// Throw an error if there's a problem parsing the response
|
|
37
31
|
throw Error('failed to parse response');
|
|
38
32
|
}
|
|
39
|
-
}
|
|
33
|
+
};
|
|
40
34
|
export default blobSelector;
|
|
41
35
|
//# sourceMappingURL=blob-selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob-selector.js","sourceRoot":"","sources":["../../../../src/lib/selectors/blob-selector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blob-selector.js","sourceRoot":"","sources":["../../../../src/lib/selectors/blob-selector.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAqB,KAAK,EACjD,QAAmB,EACE,EAAE;IACvB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,2DAA2D;QAC3D,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,0DAA0D;IAC1D,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC;IAED,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO;SAC9B,GAAG,CAAC,qBAAqB,CAAC;QAC3B,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACrC,EAAE,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,EAAE,IAAI,EAAE,CAAC;IAEX,IAAI,CAAC;QACH,kEAAkE;QAClE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,2DAA2D;QAC3D,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { HttpJsonResponseError } from '../../errors';
|
|
11
2
|
/**
|
|
12
3
|
* Asynchronously parses the JSON data from a given HTTP response.
|
|
@@ -22,14 +13,14 @@ import { HttpJsonResponseError } from '../../errors';
|
|
|
22
13
|
* @param response - The HTTP response to parse.
|
|
23
14
|
* @returns A promise that resolves with the parsed JSON data, or rejects with an `HttpJsonResponseError`.
|
|
24
15
|
*/
|
|
25
|
-
export const jsonSelector = (response) =>
|
|
16
|
+
export const jsonSelector = async (response) => {
|
|
26
17
|
/** Status code 204 indicates no content in the response */
|
|
27
18
|
if (response.status === 204) {
|
|
28
19
|
return Promise.resolve();
|
|
29
20
|
}
|
|
30
21
|
try {
|
|
31
22
|
// Parse the response JSON data
|
|
32
|
-
const data =
|
|
23
|
+
const data = await response.json();
|
|
33
24
|
// Check if the response was successful
|
|
34
25
|
if (!response.ok) {
|
|
35
26
|
// Throw an error with the response details
|
|
@@ -46,6 +37,6 @@ export const jsonSelector = (response) => __awaiter(void 0, void 0, void 0, func
|
|
|
46
37
|
// Otherwise, throw a new HttpJsonResponseError with the parsing error
|
|
47
38
|
throw new HttpJsonResponseError('failed to parse response', response, { cause });
|
|
48
39
|
}
|
|
49
|
-
}
|
|
40
|
+
};
|
|
50
41
|
export default jsonSelector;
|
|
51
42
|
//# sourceMappingURL=json-selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-selector.js","sourceRoot":"","sources":["../../../../src/lib/selectors/json-selector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-selector.js","sourceRoot":"","sources":["../../../../src/lib/selectors/json-selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,YAAY,GAAqB,KAAK,EAIjD,QAAmB,EACH,EAAE;IAClB,2DAA2D;IAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,OAAO,EAAoB,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC;QACH,+BAA+B;QAC/B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEnC,uCAAuC;QACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,2CAA2C;YAC3C,MAAM,IAAI,qBAAqB,CAAC,6BAA6B,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACrF,CAAC;QAED,yBAAyB;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,uDAAuD;QACvD,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;YAC3C,MAAM,KAAK,CAAC;QACd,CAAC;QAED,sEAAsE;QACtE,MAAM,IAAI,qBAAqB,CAAC,0BAA0B,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/esm/module.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
2
|
import { HttpClientMsal } from './lib/client';
|
|
12
3
|
import { HttpClientConfigurator, } from './configurator';
|
|
@@ -38,27 +29,27 @@ export const module = {
|
|
|
38
29
|
* @param requireInstance - A function to get an instance of a module.
|
|
39
30
|
* @returns A promise that resolves to the HTTP client provider.
|
|
40
31
|
*/
|
|
41
|
-
initialize:
|
|
32
|
+
initialize: async ({ config, hasModule, requireInstance, }) => {
|
|
42
33
|
const httpProvider = new HttpClientProvider(config);
|
|
43
34
|
if (hasModule('auth')) {
|
|
44
|
-
const authProvider =
|
|
45
|
-
httpProvider.defaultHttpRequestHandler.set('MSAL', (request) =>
|
|
35
|
+
const authProvider = await requireInstance('auth');
|
|
36
|
+
httpProvider.defaultHttpRequestHandler.set('MSAL', async (request) => {
|
|
46
37
|
const { scopes = [] } = request;
|
|
47
38
|
if (scopes.length) {
|
|
48
39
|
/** TODO should be try catch, check caller for handling */
|
|
49
|
-
const token =
|
|
40
|
+
const token = await authProvider.acquireToken({
|
|
50
41
|
scopes,
|
|
51
42
|
});
|
|
52
43
|
if (token) {
|
|
53
44
|
const headers = new Headers(request.headers);
|
|
54
45
|
headers.set('Authorization', `Bearer ${token.accessToken}`);
|
|
55
|
-
return
|
|
46
|
+
return { ...request, headers };
|
|
56
47
|
}
|
|
57
48
|
}
|
|
58
|
-
})
|
|
49
|
+
});
|
|
59
50
|
}
|
|
60
51
|
return httpProvider;
|
|
61
|
-
}
|
|
52
|
+
},
|
|
62
53
|
};
|
|
63
54
|
/**
|
|
64
55
|
* Configures the HTTP module with MSAL authentication.
|
package/dist/esm/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAEL,sBAAsB,GAEvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA4B,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAkC1E;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAmB;IACpC,IAAI,EAAE,MAAM;IACZ;;;;;;;;OAQG;IACH,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,sBAAsB,CAAC,cAAc,CAAC;IAE3D;;;;;;;;;;;OAWG;IACH,UAAU,EAAE,KAAK,EAAE,EACjB,MAAM,EACN,SAAS,EACT,eAAe,GAChB,EAA+C,EAAE;QAChD,MAAM,YAAY,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;YACnD,YAAY,CAAC,yBAAyB,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBACnE,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;gBAChC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;oBAClB,0DAA0D;oBAC1D,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC;wBAC5C,MAAM;qBACP,CAAC,CAAC;oBACH,IAAI,KAAK,EAAE,CAAC;wBACV,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;wBAC7C,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;wBAC5D,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;oBACjC,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,SAAyE,EAC9B,EAAE,CAAC,CAAC;IAC/C,MAAM;IACN,SAAS;CACV,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAAY,EACZ,IAAuC,EACI,EAAE,CAAC,CAAC;IAC/C,MAAM;IACN,SAAS,EAAE,CAAC,MAAwC,EAAE,EAAE;QACtD,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACF,CAAC,CAAC;AAWH,eAAe,MAAM,CAAC"}
|
package/dist/esm/provider.js
CHANGED
|
@@ -27,6 +27,7 @@ const isURL = (url) => {
|
|
|
27
27
|
* It provides methods to check if a client is configured, create new client instances, and create custom client instances.
|
|
28
28
|
*/
|
|
29
29
|
export class HttpClientProvider {
|
|
30
|
+
config;
|
|
30
31
|
/**
|
|
31
32
|
* Gets the default HTTP request handler for the HTTP client provider.
|
|
32
33
|
* @returns The default HTTP request handler.
|
|
@@ -71,7 +72,7 @@ export class HttpClientProvider {
|
|
|
71
72
|
const options = { requestHandler };
|
|
72
73
|
const instance = new ctor(baseUri || '', options);
|
|
73
74
|
Object.assign(instance, { defaultScopes });
|
|
74
|
-
onCreate
|
|
75
|
+
onCreate?.(instance);
|
|
75
76
|
return instance;
|
|
76
77
|
}
|
|
77
78
|
/**
|