@equinor/fusion-framework-module-http 7.0.6-next.0 → 7.0.6
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 +33 -12
- package/dist/esm/configurator.js.map +1 -1
- 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/configurator.ts +2 -3
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 7.0.6
|
|
3
|
+
## 7.0.6
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#3866](https://github.com/equinor/fusion-framework/pull/3866) [`f70d66f`](https://github.com/equinor/fusion-framework/commit/f70d66f1bc826e614140adb2c6ee052f98e3b3da) Thanks [@dependabot](https://github.com/apps/dependabot)! - Internal: Dedupe zod dependency to 4.3.5
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Deduplicated zod dependency to version 4.3.5 across all packages using `pnpm dedupe`. This aligns all packages (AI plugins upgraded from v3.25.76, other packages consolidated from v4.1.8/v4.1.11) to use the same latest stable version, improving consistency and reducing bundle size. All builds, tests, and linting pass successfully.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`f70d66f`](https://github.com/equinor/fusion-framework/commit/f70d66f1bc826e614140adb2c6ee052f98e3b3da)]:
|
|
12
|
+
- @equinor/fusion-framework-module-msal@6.0.5
|
|
12
13
|
|
|
13
14
|
## 7.0.5
|
|
14
15
|
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
### Patch Changes
|
|
60
61
|
|
|
61
62
|
- [#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
|
|
63
|
+
|
|
62
64
|
- **v4.1.10**: Fixed shape caching issue (#5263) improving validation performance for complex schemas
|
|
63
65
|
- **v4.1.11**: Maintenance release with general improvements
|
|
64
66
|
|
|
@@ -77,6 +79,7 @@
|
|
|
77
79
|
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.
|
|
78
80
|
|
|
79
81
|
Key changes in source code:
|
|
82
|
+
|
|
80
83
|
- Updated ZodError `.errors` to `.issues` property in capitalize-request-method operator
|
|
81
84
|
- Replaced `z.custom()` with `z.string().refine()` for better v4 compatibility in request method casing validation
|
|
82
85
|
- Simplified error message configuration in request method verb validation
|
|
@@ -85,6 +88,7 @@
|
|
|
85
88
|
Breaking changes: Error handling structure has changed to use new zod v4 error format.
|
|
86
89
|
|
|
87
90
|
Links:
|
|
91
|
+
|
|
88
92
|
- [Zod v4 Migration Guide](https://github.com/colinhacks/zod/releases/tag/v4.0.0)
|
|
89
93
|
- [Zod v4.1.8 Release Notes](https://github.com/colinhacks/zod/releases/tag/v4.1.8)
|
|
90
94
|
|
|
@@ -100,6 +104,7 @@
|
|
|
100
104
|
- [#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.
|
|
101
105
|
|
|
102
106
|
## Breaking Changes
|
|
107
|
+
|
|
103
108
|
- **Node.js Requirements**: Requires Node.js 18+ (already satisfied)
|
|
104
109
|
- **Vite Compatibility**: Updated to work with Vite 7.x (already using Vite 7.1.5)
|
|
105
110
|
- **Snapshot Format**: Snapshots now use backtick quotes (\`) instead of single quotes
|
|
@@ -107,15 +112,18 @@
|
|
|
107
112
|
- **TypeScript Support**: Enhanced TypeScript integration and type definitions
|
|
108
113
|
|
|
109
114
|
## Security Updates
|
|
115
|
+
|
|
110
116
|
- CVE-2025-24963: Browser mode serves arbitrary files (fixed in 2.1.9)
|
|
111
117
|
- CVE-2025-24964: Remote Code Execution vulnerability (fixed in 2.1.9)
|
|
112
118
|
|
|
113
119
|
## Migration Notes
|
|
120
|
+
|
|
114
121
|
- Test snapshots may need regeneration due to quote format changes
|
|
115
122
|
- Some test configurations might need updates for new TypeScript support
|
|
116
123
|
- Peer dependency warnings for @vitest/coverage-v8 are expected and safe to ignore
|
|
117
124
|
|
|
118
125
|
## Links
|
|
126
|
+
|
|
119
127
|
- [Vitest 3.0 Migration Guide](https://vitest.dev/guide/migration)
|
|
120
128
|
- [Vitest 3.2.4 Release Notes](https://github.com/vitest-dev/vitest/releases/tag/v3.2.4)
|
|
121
129
|
|
|
@@ -127,6 +135,7 @@
|
|
|
127
135
|
### Patch Changes
|
|
128
136
|
|
|
129
137
|
- [#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
|
|
138
|
+
|
|
130
139
|
- The HTTP module now uses the correct method `acquireAccessToken` from the auth provider to retrieve the access token for requests with scopes.
|
|
131
140
|
- This fixes compatibility with the new MSAL node module interface, which no longer exposes `acquireToken` but instead provides `acquireAccessToken` for token retrieval.
|
|
132
141
|
- Ensures the Authorization header is set correctly for authenticated HTTP requests.
|
|
@@ -144,6 +153,7 @@
|
|
|
144
153
|
### Patch Changes
|
|
145
154
|
|
|
146
155
|
- [#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
|
|
156
|
+
|
|
147
157
|
- Updated package.json typesVersions.
|
|
148
158
|
- Ensures backward compatibility with older node versions.
|
|
149
159
|
- Ensured consistency with workspace and repository configuration.
|
|
@@ -174,6 +184,7 @@
|
|
|
174
184
|
### Minor Changes
|
|
175
185
|
|
|
176
186
|
- [#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
|
|
187
|
+
|
|
177
188
|
- Introduced support for Server-Sent Events (SSE) in the HTTP module.
|
|
178
189
|
- Added `sse# Change Log method to `HttpClient` for subscribing to SSE streams.
|
|
179
190
|
- Added `sseMap` operator for handling SSE in RxJS pipelines.
|
|
@@ -181,6 +192,7 @@
|
|
|
181
192
|
- Enhanced error handling with `ServerSentEventResponseError`.
|
|
182
193
|
|
|
183
194
|
### Documentation
|
|
195
|
+
|
|
184
196
|
- Updated README with examples and usage details for SSE support.
|
|
185
197
|
|
|
186
198
|
### Patch Changes
|
|
@@ -243,6 +255,7 @@
|
|
|
243
255
|
### Minor Changes
|
|
244
256
|
|
|
245
257
|
- [#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.
|
|
258
|
+
|
|
246
259
|
- Introduced `capitalizeRequestMethodOperator` which processes an HTTP request object and converts its method to uppercase.
|
|
247
260
|
- Logs a warning if the HTTP method was converted, providing information about the change and a reference to RFC 7231 Section 4.1.
|
|
248
261
|
|
|
@@ -263,7 +276,7 @@
|
|
|
263
276
|
const httpClient = new HttpClient();
|
|
264
277
|
httpClient.requestHandler.add(
|
|
265
278
|
"capatalize-method",
|
|
266
|
-
capitalizeRequestMethodOperator()
|
|
279
|
+
capitalizeRequestMethodOperator()
|
|
267
280
|
);
|
|
268
281
|
|
|
269
282
|
// transforms `method` to uppercase and logs a warning.
|
|
@@ -381,7 +394,7 @@
|
|
|
381
394
|
// Add the request validation operator to the HttpClient.
|
|
382
395
|
httpClient.requestHandler.add(
|
|
383
396
|
"validate-init",
|
|
384
|
-
requestValidationOperator({ parse: true })
|
|
397
|
+
requestValidationOperator({ parse: true })
|
|
385
398
|
);
|
|
386
399
|
|
|
387
400
|
// will throw an error because of invalid method.
|
|
@@ -439,6 +452,7 @@
|
|
|
439
452
|
### Patch Changes
|
|
440
453
|
|
|
441
454
|
- [#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.
|
|
455
|
+
|
|
442
456
|
- added introduction to http module
|
|
443
457
|
- added concepts section which highlights the key concepts of http module
|
|
444
458
|
- added sequence diagram for http request execution
|
|
@@ -452,12 +466,14 @@
|
|
|
452
466
|
- [#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
|
|
453
467
|
|
|
454
468
|
- [#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`.
|
|
469
|
+
|
|
455
470
|
- Updated the `FetchRequestInit` type to include a new property `selector` of type `ResponseSelector<TReturn, TResponse>`, which allows specifying a response selector function.
|
|
456
471
|
- Updated the blob-selector and json-selector functions to use the new `ResponseSelector` type.
|
|
457
472
|
|
|
458
473
|
- [#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.
|
|
459
474
|
|
|
460
475
|
Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
|
|
476
|
+
|
|
461
477
|
1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
|
|
462
478
|
2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
|
|
463
479
|
3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
|
|
@@ -506,6 +522,7 @@
|
|
|
506
522
|
### Major Changes
|
|
507
523
|
|
|
508
524
|
- [#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.
|
|
525
|
+
|
|
509
526
|
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.
|
|
510
527
|
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.
|
|
511
528
|
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.
|
|
@@ -528,7 +545,7 @@
|
|
|
528
545
|
|
|
529
546
|
```typescript
|
|
530
547
|
const customBlobSelector = async (
|
|
531
|
-
response: Response
|
|
548
|
+
response: Response
|
|
532
549
|
): Promise<{ filename: string; blob: Blob }> => {
|
|
533
550
|
// Extract filename and blob from the response
|
|
534
551
|
const { filename, blob } = await blobSelector(response);
|
|
@@ -572,12 +589,12 @@
|
|
|
572
589
|
if (data) {
|
|
573
590
|
console.error(
|
|
574
591
|
"the request was not `ok`, see provided error data",
|
|
575
|
-
data
|
|
592
|
+
data
|
|
576
593
|
);
|
|
577
594
|
} else {
|
|
578
595
|
console.error(
|
|
579
596
|
"failed to parse data from response, see provided cause",
|
|
580
|
-
cause
|
|
597
|
+
cause
|
|
581
598
|
);
|
|
582
599
|
}
|
|
583
600
|
}
|
|
@@ -629,7 +646,7 @@
|
|
|
629
646
|
|
|
630
647
|
// generate a RequestInit object
|
|
631
648
|
const fooRequest = await lastValueFrom(
|
|
632
|
-
fooClient.requestHandler.process({ path: "/api", uri: fooClient.uri })
|
|
649
|
+
fooClient.requestHandler.process({ path: "/api", uri: fooClient.uri })
|
|
633
650
|
);
|
|
634
651
|
|
|
635
652
|
expect((fooRequest.headers as Headers)?.get("x-foo")).toBe("bar");
|
|
@@ -639,7 +656,7 @@
|
|
|
639
656
|
|
|
640
657
|
// generate a RequestInit object
|
|
641
658
|
const barRequest = await lastValueFrom(
|
|
642
|
-
barClient.requestHandler.process({ path: "/api", uri: barClient.uri })
|
|
659
|
+
barClient.requestHandler.process({ path: "/api", uri: barClient.uri })
|
|
643
660
|
);
|
|
644
661
|
|
|
645
662
|
// expect the request header to not been modified
|
|
@@ -705,6 +722,7 @@
|
|
|
705
722
|
- [#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**
|
|
706
723
|
|
|
707
724
|
In packages/modules/http/src/errors.ts:
|
|
725
|
+
|
|
708
726
|
- The class HttpResponseError now has a generic parameter TResponse.
|
|
709
727
|
- Added a static property Name to the class.
|
|
710
728
|
- Added a new class HttpJsonResponseError which extends HttpResponseError and also has generic parameters TType and TResponse.
|
|
@@ -713,6 +731,7 @@
|
|
|
713
731
|
- Modified the constructor to accept an optional data parameter.
|
|
714
732
|
|
|
715
733
|
In packages/modules/http/src/lib/selectors/json-selector.ts:
|
|
734
|
+
|
|
716
735
|
- Added an import statement for HttpJsonResponseError.
|
|
717
736
|
- Modified the jsonSelector function to handle errors when parsing the response.
|
|
718
737
|
- Added a try-catch block.
|
|
@@ -745,6 +764,7 @@
|
|
|
745
764
|
### Minor Changes
|
|
746
765
|
|
|
747
766
|
- [#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
|
|
767
|
+
|
|
748
768
|
- added selector for extracting blob from response
|
|
749
769
|
- added function for fetching blob as stream or promise on the http client
|
|
750
770
|
|
|
@@ -797,6 +817,7 @@
|
|
|
797
817
|
### Patch Changes
|
|
798
818
|
|
|
799
819
|
- [#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**
|
|
820
|
+
|
|
800
821
|
- align all versions of typescript
|
|
801
822
|
- update types to build
|
|
802
823
|
- 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 +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;
|
|
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;AAuHzB,kBAAkB;AAClB,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.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"}
|