@equinor/fusion-framework-module-http 7.0.7 → 7.0.9-next.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 +27 -27
- 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 +4 -4
- package/src/lib/client/types.ts +4 -6
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 7.0.9-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`f647825`](https://github.com/equinor/fusion-framework/commit/f647825cb5712763b09dafda21fd996211c78b78) Thanks [@odinr](https://github.com/odinr)! - relase next
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`f647825`](https://github.com/equinor/fusion-framework/commit/f647825cb5712763b09dafda21fd996211c78b78)]:
|
|
10
|
+
- @equinor/fusion-framework-module@5.0.7-next.0
|
|
11
|
+
- @equinor/fusion-framework-module-msal@7.3.2-next.0
|
|
12
|
+
|
|
13
|
+
## 7.0.8
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#4157](https://github.com/equinor/fusion-framework/pull/4157) [`6aa8e1f`](https://github.com/equinor/fusion-framework/commit/6aa8e1f5c9d852b25e97aa7d98a63008c64d4581) Thanks [@Noggling](https://github.com/Noggling)! - Internal: patch release to align TypeScript types across packages for consistent type compatibility.
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`6aa8e1f`](https://github.com/equinor/fusion-framework/commit/6aa8e1f5c9d852b25e97aa7d98a63008c64d4581), [`db8fa81`](https://github.com/equinor/fusion-framework/commit/db8fa8134b77a628b15e06f7f72b50f04ef97458)]:
|
|
20
|
+
- @equinor/fusion-framework-module@5.0.6
|
|
21
|
+
- @equinor/fusion-framework-module-msal@7.3.1
|
|
22
|
+
|
|
3
23
|
## 7.0.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -67,7 +87,6 @@
|
|
|
67
87
|
### Patch Changes
|
|
68
88
|
|
|
69
89
|
- [#3428](https://github.com/equinor/fusion-framework/pull/3428) [`1700ca8`](https://github.com/equinor/fusion-framework/commit/1700ca8851fa108e55e9729fd24f595272766e63) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update zod from 4.1.9 to 4.1.11
|
|
70
|
-
|
|
71
90
|
- **v4.1.10**: Fixed shape caching issue (#5263) improving validation performance for complex schemas
|
|
72
91
|
- **v4.1.11**: Maintenance release with general improvements
|
|
73
92
|
|
|
@@ -86,7 +105,6 @@
|
|
|
86
105
|
Updated source code to migrate from zod v3 to v4. Updated zod dependency from v3.25.76 to v4.1.8 and modified error handling in the HTTP module to use ZodError `.issues` property instead of `.errors` and replaced `z.custom()` with `z.string().refine()` for better v4 compatibility.
|
|
87
106
|
|
|
88
107
|
Key changes in source code:
|
|
89
|
-
|
|
90
108
|
- Updated ZodError `.errors` to `.issues` property in capitalize-request-method operator
|
|
91
109
|
- Replaced `z.custom()` with `z.string().refine()` for better v4 compatibility in request method casing validation
|
|
92
110
|
- Simplified error message configuration in request method verb validation
|
|
@@ -95,7 +113,6 @@
|
|
|
95
113
|
Breaking changes: Error handling structure has changed to use new zod v4 error format.
|
|
96
114
|
|
|
97
115
|
Links:
|
|
98
|
-
|
|
99
116
|
- [Zod v4 Migration Guide](https://github.com/colinhacks/zod/releases/tag/v4.0.0)
|
|
100
117
|
- [Zod v4.1.8 Release Notes](https://github.com/colinhacks/zod/releases/tag/v4.1.8)
|
|
101
118
|
|
|
@@ -111,7 +128,6 @@
|
|
|
111
128
|
- [#2910](https://github.com/equinor/fusion-framework/pull/2910) [`07cc985`](https://github.com/equinor/fusion-framework/commit/07cc9857e1427b574e011cc319518e701dba784d) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updated vitest from 2.1.9 to 3.2.4 across all packages.
|
|
112
129
|
|
|
113
130
|
## Breaking Changes
|
|
114
|
-
|
|
115
131
|
- **Node.js Requirements**: Requires Node.js 18+ (already satisfied)
|
|
116
132
|
- **Vite Compatibility**: Updated to work with Vite 7.x (already using Vite 7.1.5)
|
|
117
133
|
- **Snapshot Format**: Snapshots now use backtick quotes (\`) instead of single quotes
|
|
@@ -119,18 +135,15 @@
|
|
|
119
135
|
- **TypeScript Support**: Enhanced TypeScript integration and type definitions
|
|
120
136
|
|
|
121
137
|
## Security Updates
|
|
122
|
-
|
|
123
138
|
- CVE-2025-24963: Browser mode serves arbitrary files (fixed in 2.1.9)
|
|
124
139
|
- CVE-2025-24964: Remote Code Execution vulnerability (fixed in 2.1.9)
|
|
125
140
|
|
|
126
141
|
## Migration Notes
|
|
127
|
-
|
|
128
142
|
- Test snapshots may need regeneration due to quote format changes
|
|
129
143
|
- Some test configurations might need updates for new TypeScript support
|
|
130
144
|
- Peer dependency warnings for @vitest/coverage-v8 are expected and safe to ignore
|
|
131
145
|
|
|
132
146
|
## Links
|
|
133
|
-
|
|
134
147
|
- [Vitest 3.0 Migration Guide](https://vitest.dev/guide/migration)
|
|
135
148
|
- [Vitest 3.2.4 Release Notes](https://github.com/vitest-dev/vitest/releases/tag/v3.2.4)
|
|
136
149
|
|
|
@@ -142,7 +155,6 @@
|
|
|
142
155
|
### Patch Changes
|
|
143
156
|
|
|
144
157
|
- [#3075](https://github.com/equinor/fusion-framework/pull/3075) [`8fffbfb`](https://github.com/equinor/fusion-framework/commit/8fffbfb12daa9748bf5290e5084cd4d409aed253) Thanks [@odinr](https://github.com/odinr)! - fix(http): use acquireAccessToken instead of acquireToken
|
|
145
|
-
|
|
146
158
|
- The HTTP module now uses the correct method `acquireAccessToken` from the auth provider to retrieve the access token for requests with scopes.
|
|
147
159
|
- This fixes compatibility with the new MSAL node module interface, which no longer exposes `acquireToken` but instead provides `acquireAccessToken` for token retrieval.
|
|
148
160
|
- Ensures the Authorization header is set correctly for authenticated HTTP requests.
|
|
@@ -160,7 +172,6 @@
|
|
|
160
172
|
### Patch Changes
|
|
161
173
|
|
|
162
174
|
- [#3088](https://github.com/equinor/fusion-framework/pull/3088) [`7441b13`](https://github.com/equinor/fusion-framework/commit/7441b13aa50dd7362d1629086a27b6b4e571575d) Thanks [@eikeland](https://github.com/eikeland)! - chore: update package typesVersions
|
|
163
|
-
|
|
164
175
|
- Updated package.json typesVersions.
|
|
165
176
|
- Ensures backward compatibility with older node versions.
|
|
166
177
|
- Ensured consistency with workspace and repository configuration.
|
|
@@ -191,7 +202,6 @@
|
|
|
191
202
|
### Minor Changes
|
|
192
203
|
|
|
193
204
|
- [#3038](https://github.com/equinor/fusion-framework/pull/3038) [`7a0a510`](https://github.com/equinor/fusion-framework/commit/7a0a510e0af1f0769c596e1b9aaa391250efd95d) Thanks [@odinr](https://github.com/odinr)! - ### Added
|
|
194
|
-
|
|
195
205
|
- Introduced support for Server-Sent Events (SSE) in the HTTP module.
|
|
196
206
|
- Added `sse# Change Log method to `HttpClient` for subscribing to SSE streams.
|
|
197
207
|
- Added `sseMap` operator for handling SSE in RxJS pipelines.
|
|
@@ -199,7 +209,6 @@
|
|
|
199
209
|
- Enhanced error handling with `ServerSentEventResponseError`.
|
|
200
210
|
|
|
201
211
|
### Documentation
|
|
202
|
-
|
|
203
212
|
- Updated README with examples and usage details for SSE support.
|
|
204
213
|
|
|
205
214
|
### Patch Changes
|
|
@@ -262,7 +271,6 @@
|
|
|
262
271
|
### Minor Changes
|
|
263
272
|
|
|
264
273
|
- [#2491](https://github.com/equinor/fusion-framework/pull/2491) [`73af73e`](https://github.com/equinor/fusion-framework/commit/73af73e5582ca27b132210af8ba308b80e036d51) Thanks [@odinr](https://github.com/odinr)! - Added a new operator `capitalizeRequestMethodOperator` to ensure that the HTTP method of a given request is in uppercase.
|
|
265
|
-
|
|
266
274
|
- Introduced `capitalizeRequestMethodOperator` which processes an HTTP request object and converts its method to uppercase.
|
|
267
275
|
- Logs a warning if the HTTP method was converted, providing information about the change and a reference to RFC 7231 Section 4.1.
|
|
268
276
|
|
|
@@ -283,7 +291,7 @@
|
|
|
283
291
|
const httpClient = new HttpClient();
|
|
284
292
|
httpClient.requestHandler.add(
|
|
285
293
|
"capatalize-method",
|
|
286
|
-
capitalizeRequestMethodOperator()
|
|
294
|
+
capitalizeRequestMethodOperator(),
|
|
287
295
|
);
|
|
288
296
|
|
|
289
297
|
// transforms `method` to uppercase and logs a warning.
|
|
@@ -401,7 +409,7 @@
|
|
|
401
409
|
// Add the request validation operator to the HttpClient.
|
|
402
410
|
httpClient.requestHandler.add(
|
|
403
411
|
"validate-init",
|
|
404
|
-
requestValidationOperator({ parse: true })
|
|
412
|
+
requestValidationOperator({ parse: true }),
|
|
405
413
|
);
|
|
406
414
|
|
|
407
415
|
// will throw an error because of invalid method.
|
|
@@ -459,7 +467,6 @@
|
|
|
459
467
|
### Patch Changes
|
|
460
468
|
|
|
461
469
|
- [#2324](https://github.com/equinor/fusion-framework/pull/2324) [`788d0b9`](https://github.com/equinor/fusion-framework/commit/788d0b93edc25e5b682d88c58614560c204c1af9) Thanks [@odinr](https://github.com/odinr)! - Updated documentation in `README.md` for http module.
|
|
462
|
-
|
|
463
470
|
- added introduction to http module
|
|
464
471
|
- added concepts section which highlights the key concepts of http module
|
|
465
472
|
- added sequence diagram for http request execution
|
|
@@ -473,14 +480,12 @@
|
|
|
473
480
|
- [#2324](https://github.com/equinor/fusion-framework/pull/2324) [`788d0b9`](https://github.com/equinor/fusion-framework/commit/788d0b93edc25e5b682d88c58614560c204c1af9) Thanks [@odinr](https://github.com/odinr)! - Updated TsDoc for http module
|
|
474
481
|
|
|
475
482
|
- [#2324](https://github.com/equinor/fusion-framework/pull/2324) [`788d0b9`](https://github.com/equinor/fusion-framework/commit/788d0b93edc25e5b682d88c58614560c204c1af9) Thanks [@odinr](https://github.com/odinr)! - - Added a new type `ResponseSelector<TResult, TResponse>`: a function that takes a `Response` object and returns an observable stream of type `TResult`. The `ResponseSelector` type has two template parameters: `TResult` and `TResponse`.
|
|
476
|
-
|
|
477
483
|
- Updated the `FetchRequestInit` type to include a new property `selector` of type `ResponseSelector<TReturn, TResponse>`, which allows specifying a response selector function.
|
|
478
484
|
- Updated the blob-selector and json-selector functions to use the new `ResponseSelector` type.
|
|
479
485
|
|
|
480
486
|
- [#2320](https://github.com/equinor/fusion-framework/pull/2320) [`1dd85f3`](https://github.com/equinor/fusion-framework/commit/1dd85f3a408a73df556d1812a5f280945cc100ee) Thanks [@odinr](https://github.com/odinr)! - Removed the `removeComments` option from the `tsconfig.base.json` file.
|
|
481
487
|
|
|
482
488
|
Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
|
|
483
|
-
|
|
484
489
|
1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
|
|
485
490
|
2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
|
|
486
491
|
3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
|
|
@@ -529,7 +534,6 @@
|
|
|
529
534
|
### Major Changes
|
|
530
535
|
|
|
531
536
|
- [#2181](https://github.com/equinor/fusion-framework/pull/2181) [`ba2379b`](https://github.com/equinor/fusion-framework/commit/ba2379b177f23ccc023894e36e50d7fc56c929c8) Thanks [@odinr](https://github.com/odinr)! - The `blob` and `blob# Change Log methods in the `HttpClient` class have been updated to provide a more robust and flexible API for fetching blob resources.
|
|
532
|
-
|
|
533
537
|
1. The `blob` and `blob# Change Log methods now accept an optional `args`parameter of type`FetchRequestInit<T, TRequest, TResponse>`, where `T` is the type of the expected blob result. This allows consumers to customize the fetch request and response handling.
|
|
534
538
|
2. The `blob` and `blob# Change Log methods now return a `Promise<T>`and`StreamResponse<T>`respectively, where`T` is the type of the expected blob result. This allows consumers to handle the blob data in a more type-safe manner.
|
|
535
539
|
3. The `blobSelector` function has been updated to extract the filename (if available) from the `content-disposition` header and return it along with the blob data in a `BlobResult` object.
|
|
@@ -552,7 +556,7 @@
|
|
|
552
556
|
|
|
553
557
|
```typescript
|
|
554
558
|
const customBlobSelector = async (
|
|
555
|
-
response: Response
|
|
559
|
+
response: Response,
|
|
556
560
|
): Promise<{ filename: string; blob: Blob }> => {
|
|
557
561
|
// Extract filename and blob from the response
|
|
558
562
|
const { filename, blob } = await blobSelector(response);
|
|
@@ -596,12 +600,12 @@
|
|
|
596
600
|
if (data) {
|
|
597
601
|
console.error(
|
|
598
602
|
"the request was not `ok`, see provided error data",
|
|
599
|
-
data
|
|
603
|
+
data,
|
|
600
604
|
);
|
|
601
605
|
} else {
|
|
602
606
|
console.error(
|
|
603
607
|
"failed to parse data from response, see provided cause",
|
|
604
|
-
cause
|
|
608
|
+
cause,
|
|
605
609
|
);
|
|
606
610
|
}
|
|
607
611
|
}
|
|
@@ -653,7 +657,7 @@
|
|
|
653
657
|
|
|
654
658
|
// generate a RequestInit object
|
|
655
659
|
const fooRequest = await lastValueFrom(
|
|
656
|
-
fooClient.requestHandler.process({ path: "/api", uri: fooClient.uri })
|
|
660
|
+
fooClient.requestHandler.process({ path: "/api", uri: fooClient.uri }),
|
|
657
661
|
);
|
|
658
662
|
|
|
659
663
|
expect((fooRequest.headers as Headers)?.get("x-foo")).toBe("bar");
|
|
@@ -663,7 +667,7 @@
|
|
|
663
667
|
|
|
664
668
|
// generate a RequestInit object
|
|
665
669
|
const barRequest = await lastValueFrom(
|
|
666
|
-
barClient.requestHandler.process({ path: "/api", uri: barClient.uri })
|
|
670
|
+
barClient.requestHandler.process({ path: "/api", uri: barClient.uri }),
|
|
667
671
|
);
|
|
668
672
|
|
|
669
673
|
// expect the request header to not been modified
|
|
@@ -729,7 +733,6 @@
|
|
|
729
733
|
- [#1621](https://github.com/equinor/fusion-framework/pull/1621) [`0af3540`](https://github.com/equinor/fusion-framework/commit/0af3540340bac85a19ca3a8ec4e0ccd42b3090ee) Thanks [@odinr](https://github.com/odinr)! - **Improves error handling when processing json http response**
|
|
730
734
|
|
|
731
735
|
In packages/modules/http/src/errors.ts:
|
|
732
|
-
|
|
733
736
|
- The class HttpResponseError now has a generic parameter TResponse.
|
|
734
737
|
- Added a static property Name to the class.
|
|
735
738
|
- Added a new class HttpJsonResponseError which extends HttpResponseError and also has generic parameters TType and TResponse.
|
|
@@ -738,7 +741,6 @@
|
|
|
738
741
|
- Modified the constructor to accept an optional data parameter.
|
|
739
742
|
|
|
740
743
|
In packages/modules/http/src/lib/selectors/json-selector.ts:
|
|
741
|
-
|
|
742
744
|
- Added an import statement for HttpJsonResponseError.
|
|
743
745
|
- Modified the jsonSelector function to handle errors when parsing the response.
|
|
744
746
|
- Added a try-catch block.
|
|
@@ -771,7 +773,6 @@
|
|
|
771
773
|
### Minor Changes
|
|
772
774
|
|
|
773
775
|
- [#1242](https://github.com/equinor/fusion-framework/pull/1242) [`8e9e34a0`](https://github.com/equinor/fusion-framework/commit/8e9e34a06a6905d092ad8ca3f9330a3699da20fa) Thanks [@odinr](https://github.com/odinr)! - add method for executing blob requests
|
|
774
|
-
|
|
775
776
|
- added selector for extracting blob from response
|
|
776
777
|
- added function for fetching blob as stream or promise on the http client
|
|
777
778
|
|
|
@@ -824,7 +825,6 @@
|
|
|
824
825
|
### Patch Changes
|
|
825
826
|
|
|
826
827
|
- [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
|
|
827
|
-
|
|
828
828
|
- align all versions of typescript
|
|
829
829
|
- update types to build
|
|
830
830
|
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
|
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,cAAc,CAAC"}
|