@equinor/fusion-framework-module-http 8.1.0-next.0 → 8.1.0
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 +21 -43
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,68 +1,46 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.1.0
|
|
3
|
+
## 8.1.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
7
|
+
- f663b46: Add a `./mock` entry point built on `addMiddleware` on the real `HttpClientConfigurator`, so answering a request in a test doesn't mean swapping out a separate configurator.
|
|
8
|
+
|
|
9
9
|
```ts
|
|
10
|
-
configurator.configureHttpClient(
|
|
11
|
-
baseUri: "https://api.example.com",
|
|
12
|
-
});
|
|
10
|
+
configurator.configureHttpClient('catalog', { baseUri: 'https://api.example.com' });
|
|
13
11
|
configurator.http.addMiddleware(async (uri, init, next) =>
|
|
14
|
-
uri ===
|
|
15
|
-
? Response.json([{ id: 1 }])
|
|
16
|
-
: next(uri, init),
|
|
12
|
+
uri === 'https://api.example.com/items' ? Response.json([{ id: 1 }]) : next(uri, init),
|
|
17
13
|
);
|
|
18
14
|
```
|
|
19
|
-
|
|
15
|
+
|
|
20
16
|
`addMiddleware` wraps `_performFetch` rather than replacing it, so the exact same client and configuration a real app registers is what a test exercises — only the boundary that would reach the network is short-circuited, and a middleware that calls `next(uri, init)` falls through to the real call (or the next middleware) unchanged.
|
|
21
|
-
|
|
17
|
+
|
|
22
18
|
Two adapters are included for building a middleware:
|
|
23
|
-
|
|
19
|
+
|
|
24
20
|
- `createRouterMiddleware(baseUri, build)` — a minimal Express-like router (`.get`/`.post`/`.put`/`.patch`/`.delete`/`.on`, `:id`-style path params) for one base URI, with no dependency on a real routing library.
|
|
25
21
|
- `createOpenApiMockMiddleware(openApiMock)` — adapts an `@equinor/fusion-openapi-mock` instance, so a real `openapi.json`/`openapi.yaml` fakes every response with no handlers written at all.
|
|
26
|
-
|
|
22
|
+
|
|
27
23
|
```ts
|
|
28
|
-
import { createRouterMiddleware } from
|
|
29
|
-
|
|
24
|
+
import { createRouterMiddleware } from '@equinor/fusion-framework-module-http/mock';
|
|
25
|
+
|
|
30
26
|
configurator.http.addMiddleware(
|
|
31
|
-
createRouterMiddleware(
|
|
32
|
-
router.get(
|
|
33
|
-
Response.json({ id: params.id }),
|
|
34
|
-
);
|
|
27
|
+
createRouterMiddleware('https://context.example.com', (router) => {
|
|
28
|
+
router.get('/contexts/:id', ({ params }) => Response.json({ id: params.id }));
|
|
35
29
|
}),
|
|
36
30
|
);
|
|
37
31
|
```
|
|
38
|
-
|
|
32
|
+
|
|
39
33
|
`@equinor/fusion-framework`'s `FrameworkMockConfigurator` gains a matching `.http` accessor, backed by the same real `IHttpClientConfigurator`.
|
|
40
34
|
|
|
41
35
|
### Patch Changes
|
|
42
36
|
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- 2836e0b: Fix `HttpClient.abort()` not cancelling the underlying network call when middleware is registered. `next(...)` resolves through a `Promise`, so a middleware calling it created a subscription to `_performFetch` outside the tree the `takeUntil(this._abort$)` teardown reaches -- the outer request settled, but the real `fetch` kept running. `abort()` now also aborts a per-request `AbortSignal` combined into the request `init`, so `_performFetch` (`fromFetch` by default) is cancelled directly regardless of whether middleware severed the RxJS subscription chain.
|
|
52
|
-
- Updated dependencies [e8aae1f]
|
|
53
|
-
- Updated dependencies [2836e0b]
|
|
54
|
-
- Updated dependencies [2836e0b]
|
|
55
|
-
- Updated dependencies [2836e0b]
|
|
56
|
-
- Updated dependencies [2836e0b]
|
|
57
|
-
- Updated dependencies [2836e0b]
|
|
58
|
-
- Updated dependencies [2836e0b]
|
|
59
|
-
- Updated dependencies [2836e0b]
|
|
60
|
-
- Updated dependencies [2836e0b]
|
|
61
|
-
- Updated dependencies [2836e0b]
|
|
62
|
-
- Updated dependencies [2836e0b]
|
|
63
|
-
- Updated dependencies [2836e0b]
|
|
64
|
-
- @equinor/fusion-framework-module@6.1.3-next.0
|
|
65
|
-
- @equinor/fusion-framework-module-msal@11.0.0-next.0
|
|
37
|
+
- f663b46: Fix `HttpClient.abort()` not cancelling the underlying network call when middleware is registered. `next(...)` resolves through a `Promise`, so a middleware calling it created a subscription to `_performFetch` outside the tree the `takeUntil(this._abort$)` teardown reaches -- the outer request settled, but the real `fetch` kept running. `abort()` now also aborts a per-request `AbortSignal` combined into the request `init`, so `_performFetch` (`fromFetch` by default) is cancelled directly regardless of whether middleware severed the RxJS subscription chain.
|
|
38
|
+
- Updated dependencies [f663b46]
|
|
39
|
+
- Updated dependencies [f663b46]
|
|
40
|
+
- Updated dependencies [f663b46]
|
|
41
|
+
- Updated dependencies [f663b46]
|
|
42
|
+
- Updated dependencies [f663b46]
|
|
43
|
+
- @equinor/fusion-framework-module-msal@11.0.0
|
|
66
44
|
|
|
67
45
|
## 8.0.5
|
|
68
46
|
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|