@equinor/fusion-framework-module-http 7.0.8 → 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 CHANGED
@@ -1,5 +1,15 @@
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
+
3
13
  ## 7.0.8
4
14
 
5
15
  ### Patch Changes
@@ -77,7 +87,6 @@
77
87
  ### Patch Changes
78
88
 
79
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
80
-
81
90
  - **v4.1.10**: Fixed shape caching issue (#5263) improving validation performance for complex schemas
82
91
  - **v4.1.11**: Maintenance release with general improvements
83
92
 
@@ -96,7 +105,6 @@
96
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.
97
106
 
98
107
  Key changes in source code:
99
-
100
108
  - Updated ZodError `.errors` to `.issues` property in capitalize-request-method operator
101
109
  - Replaced `z.custom()` with `z.string().refine()` for better v4 compatibility in request method casing validation
102
110
  - Simplified error message configuration in request method verb validation
@@ -105,7 +113,6 @@
105
113
  Breaking changes: Error handling structure has changed to use new zod v4 error format.
106
114
 
107
115
  Links:
108
-
109
116
  - [Zod v4 Migration Guide](https://github.com/colinhacks/zod/releases/tag/v4.0.0)
110
117
  - [Zod v4.1.8 Release Notes](https://github.com/colinhacks/zod/releases/tag/v4.1.8)
111
118
 
@@ -121,7 +128,6 @@
121
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.
122
129
 
123
130
  ## Breaking Changes
124
-
125
131
  - **Node.js Requirements**: Requires Node.js 18+ (already satisfied)
126
132
  - **Vite Compatibility**: Updated to work with Vite 7.x (already using Vite 7.1.5)
127
133
  - **Snapshot Format**: Snapshots now use backtick quotes (\`) instead of single quotes
@@ -129,18 +135,15 @@
129
135
  - **TypeScript Support**: Enhanced TypeScript integration and type definitions
130
136
 
131
137
  ## Security Updates
132
-
133
138
  - CVE-2025-24963: Browser mode serves arbitrary files (fixed in 2.1.9)
134
139
  - CVE-2025-24964: Remote Code Execution vulnerability (fixed in 2.1.9)
135
140
 
136
141
  ## Migration Notes
137
-
138
142
  - Test snapshots may need regeneration due to quote format changes
139
143
  - Some test configurations might need updates for new TypeScript support
140
144
  - Peer dependency warnings for @vitest/coverage-v8 are expected and safe to ignore
141
145
 
142
146
  ## Links
143
-
144
147
  - [Vitest 3.0 Migration Guide](https://vitest.dev/guide/migration)
145
148
  - [Vitest 3.2.4 Release Notes](https://github.com/vitest-dev/vitest/releases/tag/v3.2.4)
146
149
 
@@ -152,7 +155,6 @@
152
155
  ### Patch Changes
153
156
 
154
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
155
-
156
158
  - The HTTP module now uses the correct method `acquireAccessToken` from the auth provider to retrieve the access token for requests with scopes.
157
159
  - This fixes compatibility with the new MSAL node module interface, which no longer exposes `acquireToken` but instead provides `acquireAccessToken` for token retrieval.
158
160
  - Ensures the Authorization header is set correctly for authenticated HTTP requests.
@@ -170,7 +172,6 @@
170
172
  ### Patch Changes
171
173
 
172
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
173
-
174
175
  - Updated package.json typesVersions.
175
176
  - Ensures backward compatibility with older node versions.
176
177
  - Ensured consistency with workspace and repository configuration.
@@ -201,7 +202,6 @@
201
202
  ### Minor Changes
202
203
 
203
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
204
-
205
205
  - Introduced support for Server-Sent Events (SSE) in the HTTP module.
206
206
  - Added `sse# Change Log method to `HttpClient` for subscribing to SSE streams.
207
207
  - Added `sseMap` operator for handling SSE in RxJS pipelines.
@@ -209,7 +209,6 @@
209
209
  - Enhanced error handling with `ServerSentEventResponseError`.
210
210
 
211
211
  ### Documentation
212
-
213
212
  - Updated README with examples and usage details for SSE support.
214
213
 
215
214
  ### Patch Changes
@@ -272,7 +271,6 @@
272
271
  ### Minor Changes
273
272
 
274
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.
275
-
276
274
  - Introduced `capitalizeRequestMethodOperator` which processes an HTTP request object and converts its method to uppercase.
277
275
  - Logs a warning if the HTTP method was converted, providing information about the change and a reference to RFC 7231 Section 4.1.
278
276
 
@@ -293,7 +291,7 @@
293
291
  const httpClient = new HttpClient();
294
292
  httpClient.requestHandler.add(
295
293
  "capatalize-method",
296
- capitalizeRequestMethodOperator()
294
+ capitalizeRequestMethodOperator(),
297
295
  );
298
296
 
299
297
  // transforms `method` to uppercase and logs a warning.
@@ -411,7 +409,7 @@
411
409
  // Add the request validation operator to the HttpClient.
412
410
  httpClient.requestHandler.add(
413
411
  "validate-init",
414
- requestValidationOperator({ parse: true })
412
+ requestValidationOperator({ parse: true }),
415
413
  );
416
414
 
417
415
  // will throw an error because of invalid method.
@@ -469,7 +467,6 @@
469
467
  ### Patch Changes
470
468
 
471
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.
472
-
473
470
  - added introduction to http module
474
471
  - added concepts section which highlights the key concepts of http module
475
472
  - added sequence diagram for http request execution
@@ -483,14 +480,12 @@
483
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
484
481
 
485
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`.
486
-
487
483
  - Updated the `FetchRequestInit` type to include a new property `selector` of type `ResponseSelector<TReturn, TResponse>`, which allows specifying a response selector function.
488
484
  - Updated the blob-selector and json-selector functions to use the new `ResponseSelector` type.
489
485
 
490
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.
491
487
 
492
488
  Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
493
-
494
489
  1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
495
490
  2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
496
491
  3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
@@ -539,7 +534,6 @@
539
534
  ### Major Changes
540
535
 
541
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.
542
-
543
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.
544
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.
545
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.
@@ -562,7 +556,7 @@
562
556
 
563
557
  ```typescript
564
558
  const customBlobSelector = async (
565
- response: Response
559
+ response: Response,
566
560
  ): Promise<{ filename: string; blob: Blob }> => {
567
561
  // Extract filename and blob from the response
568
562
  const { filename, blob } = await blobSelector(response);
@@ -606,12 +600,12 @@
606
600
  if (data) {
607
601
  console.error(
608
602
  "the request was not `ok`, see provided error data",
609
- data
603
+ data,
610
604
  );
611
605
  } else {
612
606
  console.error(
613
607
  "failed to parse data from response, see provided cause",
614
- cause
608
+ cause,
615
609
  );
616
610
  }
617
611
  }
@@ -663,7 +657,7 @@
663
657
 
664
658
  // generate a RequestInit object
665
659
  const fooRequest = await lastValueFrom(
666
- fooClient.requestHandler.process({ path: "/api", uri: fooClient.uri })
660
+ fooClient.requestHandler.process({ path: "/api", uri: fooClient.uri }),
667
661
  );
668
662
 
669
663
  expect((fooRequest.headers as Headers)?.get("x-foo")).toBe("bar");
@@ -673,7 +667,7 @@
673
667
 
674
668
  // generate a RequestInit object
675
669
  const barRequest = await lastValueFrom(
676
- barClient.requestHandler.process({ path: "/api", uri: barClient.uri })
670
+ barClient.requestHandler.process({ path: "/api", uri: barClient.uri }),
677
671
  );
678
672
 
679
673
  // expect the request header to not been modified
@@ -739,7 +733,6 @@
739
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**
740
734
 
741
735
  In packages/modules/http/src/errors.ts:
742
-
743
736
  - The class HttpResponseError now has a generic parameter TResponse.
744
737
  - Added a static property Name to the class.
745
738
  - Added a new class HttpJsonResponseError which extends HttpResponseError and also has generic parameters TType and TResponse.
@@ -748,7 +741,6 @@
748
741
  - Modified the constructor to accept an optional data parameter.
749
742
 
750
743
  In packages/modules/http/src/lib/selectors/json-selector.ts:
751
-
752
744
  - Added an import statement for HttpJsonResponseError.
753
745
  - Modified the jsonSelector function to handle errors when parsing the response.
754
746
  - Added a try-catch block.
@@ -781,7 +773,6 @@
781
773
  ### Minor Changes
782
774
 
783
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
784
-
785
776
  - added selector for extracting blob from response
786
777
  - added function for fetching blob as stream or promise on the http client
787
778
 
@@ -834,7 +825,6 @@
834
825
  ### Patch Changes
835
826
 
836
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**
837
-
838
828
  - align all versions of typescript
839
829
  - update types to build
840
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
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '7.0.8';
2
+ export const version = '7.0.9-next.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC"}