@equinor/fusion-framework-module-http 8.1.1 → 8.1.3

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.
Files changed (64) hide show
  1. package/dist/esm/configurator.js +1 -1
  2. package/dist/esm/configurator.js.map +1 -1
  3. package/dist/esm/index.js +4 -4
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/esm/lib/client/client-msal.js +1 -1
  6. package/dist/esm/lib/client/client-msal.js.map +1 -1
  7. package/dist/esm/lib/client/client.js +3 -3
  8. package/dist/esm/lib/client/client.js.map +1 -1
  9. package/dist/esm/lib/client/index.js +3 -3
  10. package/dist/esm/lib/client/index.js.map +1 -1
  11. package/dist/esm/lib/index.js +3 -3
  12. package/dist/esm/lib/index.js.map +1 -1
  13. package/dist/esm/lib/operators/HttpRequestHandler.js +2 -2
  14. package/dist/esm/lib/operators/HttpRequestHandler.js.map +1 -1
  15. package/dist/esm/lib/operators/HttpResponseHandler.js +1 -1
  16. package/dist/esm/lib/operators/HttpResponseHandler.js.map +1 -1
  17. package/dist/esm/lib/operators/capitalize-request-method-operator.js +1 -1
  18. package/dist/esm/lib/operators/capitalize-request-method-operator.js.map +1 -1
  19. package/dist/esm/lib/operators/index.js +8 -8
  20. package/dist/esm/lib/operators/index.js.map +1 -1
  21. package/dist/esm/lib/operators/request-validation-operator.js +1 -1
  22. package/dist/esm/lib/operators/request-validation-operator.js.map +1 -1
  23. package/dist/esm/lib/operators/sse-map.operator.js +1 -1
  24. package/dist/esm/lib/operators/sse-map.operator.js.map +1 -1
  25. package/dist/esm/lib/selectors/index.js +3 -3
  26. package/dist/esm/lib/selectors/index.js.map +1 -1
  27. package/dist/esm/mock/create-open-api-mock-middleware.js +1 -1
  28. package/dist/esm/mock/create-open-api-mock-middleware.js.map +1 -1
  29. package/dist/esm/mock/index.js +2 -2
  30. package/dist/esm/mock/index.js.map +1 -1
  31. package/dist/esm/module.js +3 -3
  32. package/dist/esm/module.js.map +1 -1
  33. package/dist/esm/provider.js +1 -1
  34. package/dist/esm/provider.js.map +1 -1
  35. package/dist/esm/version.js +1 -1
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/dist/types/configurator.d.ts +3 -3
  38. package/dist/types/index.d.ts +5 -5
  39. package/dist/types/lib/client/client-msal.d.ts +2 -2
  40. package/dist/types/lib/client/client.d.ts +3 -3
  41. package/dist/types/lib/client/index.d.ts +3 -3
  42. package/dist/types/lib/client/types.d.ts +1 -1
  43. package/dist/types/lib/index.d.ts +3 -3
  44. package/dist/types/lib/operators/HttpMiddlewareHandler.d.ts +1 -1
  45. package/dist/types/lib/operators/HttpRequestHandler.d.ts +2 -2
  46. package/dist/types/lib/operators/HttpResponseHandler.d.ts +1 -1
  47. package/dist/types/lib/operators/ProcessOperators.d.ts +1 -1
  48. package/dist/types/lib/operators/capitalize-request-method-operator.d.ts +1 -1
  49. package/dist/types/lib/operators/fetch-request.schemas.d.ts +6 -6
  50. package/dist/types/lib/operators/index.d.ts +8 -8
  51. package/dist/types/lib/operators/request-operator-header.d.ts +2 -2
  52. package/dist/types/lib/operators/request-validation-operator.d.ts +2 -2
  53. package/dist/types/lib/operators/sse-map.operator.d.ts +1 -1
  54. package/dist/types/lib/operators/types.d.ts +1 -1
  55. package/dist/types/lib/selectors/blob-selector.d.ts +1 -1
  56. package/dist/types/lib/selectors/index.d.ts +5 -5
  57. package/dist/types/lib/selectors/json-selector.d.ts +1 -1
  58. package/dist/types/mock/create-open-api-mock-middleware.d.ts +2 -2
  59. package/dist/types/mock/create-router-middleware.d.ts +1 -1
  60. package/dist/types/mock/index.d.ts +3 -3
  61. package/dist/types/module.d.ts +3 -3
  62. package/dist/types/provider.d.ts +4 -4
  63. package/dist/types/version.d.ts +1 -1
  64. package/package.json +6 -4
@@ -1,6 +1,6 @@
1
- import { HttpRequestHandler } from './lib/operators';
2
- import type { FetchRequest, IHttpClient } from './lib/client';
3
- import type { HttpMiddleware, IHttpMiddlewareHandler, IHttpRequestHandler, IHttpResponseHandler } from './lib/operators';
1
+ import { HttpRequestHandler } from './lib/operators/index.js';
2
+ import type { FetchRequest, IHttpClient } from './lib/client/index.js';
3
+ import type { HttpMiddleware, IHttpMiddlewareHandler, IHttpRequestHandler, IHttpResponseHandler } from './lib/operators/index.js';
4
4
  /**
5
5
  * Represents the options for constructing an `IHttpClient` instance.
6
6
  *
@@ -2,10 +2,10 @@
2
2
  * [[include:module-http/README.MD]]
3
3
  * @module
4
4
  */
5
- export * from './configurator';
6
- export * from './provider';
7
- export * from './module';
5
+ export * from './configurator.js';
6
+ export * from './provider.js';
7
+ export * from './module.js';
8
8
  export * as Errors from './errors/index.js';
9
9
  export * from './errors/index.js';
10
- export type { IHttpClient, FetchResponse } from './lib/client';
11
- export { default } from './module';
10
+ export type { IHttpClient, FetchResponse } from './lib/client/index.js';
11
+ export { default } from './module.js';
@@ -1,6 +1,6 @@
1
1
  import type { Observable } from 'rxjs';
2
- import type { FetchRequestInit, FetchRequest, FetchResponse } from '.';
3
- import { HttpClient } from './client';
2
+ import type { FetchRequestInit, FetchRequest, FetchResponse } from './index.js';
3
+ import { HttpClient } from './client.js';
4
4
  /**
5
5
  * Extends the `FetchRequest` type with an optional `scopes` property, which is an array of strings representing the scopes to be used for the request.
6
6
  * This type is used to represent a request that requires authentication using the MSAL (Microsoft Authentication Library) library.
@@ -1,8 +1,8 @@
1
1
  import { Subject } from 'rxjs';
2
2
  import type { Observable, ObservableInput } from 'rxjs';
3
- import type { IHttpMiddlewareHandler, IHttpRequestHandler, IHttpResponseHandler } from '../operators';
4
- import type { BlobResult, FetchRequest, FetchRequestInit, FetchResponse, IHttpClient, JsonRequest, StreamResponse } from './types';
5
- import { type ServerSentEvent, type SseSelectorOptions } from '../selectors/create-sse-selector';
3
+ import type { IHttpMiddlewareHandler, IHttpRequestHandler, IHttpResponseHandler } from '../operators/index.js';
4
+ import type { BlobResult, FetchRequest, FetchRequestInit, FetchResponse, IHttpClient, JsonRequest, StreamResponse } from './types.js';
5
+ import { type ServerSentEvent, type SseSelectorOptions } from '../selectors/create-sse-selector.js';
6
6
  /**
7
7
  * Configuration options for creating an `HttpClient` instance.
8
8
  *
@@ -1,3 +1,3 @@
1
- export { HttpClient } from './client';
2
- export { HttpClientMsal } from './client-msal';
3
- export * from './types';
1
+ export { HttpClient } from './client.js';
2
+ export { HttpClientMsal } from './client-msal.js';
3
+ export * from './types.js';
@@ -1,5 +1,5 @@
1
1
  import type { ObservableInput, Observable } from 'rxjs';
2
- import type { IHttpRequestHandler, IHttpResponseHandler } from '../operators/types';
2
+ import type { IHttpRequestHandler, IHttpResponseHandler } from '../operators/types.js';
3
3
  /**
4
4
  * Represents a stream of response data.
5
5
  * @template T - The type of the response data.
@@ -1,3 +1,3 @@
1
- export * from './client';
2
- export * from './operators';
3
- export * from './selectors';
1
+ export * from './client/index.js';
2
+ export * from './operators/index.js';
3
+ export * from './selectors/index.js';
@@ -1,5 +1,5 @@
1
1
  import type { Observable } from 'rxjs';
2
- import type { HttpMiddleware, HttpMiddlewareNext, IHttpMiddlewareHandler } from './types';
2
+ import type { HttpMiddleware, HttpMiddlewareNext, IHttpMiddlewareHandler } from './types.js';
3
3
  /**
4
4
  * Composes registered {@link HttpMiddleware} into a single execution pipeline wrapping the
5
5
  * network call, so retries, caching, telemetry, or circuit-breaking can wrap `_performFetch`
@@ -1,5 +1,5 @@
1
- import { ProcessOperators } from './ProcessOperators';
2
- import type { FetchRequest } from '../client';
1
+ import { ProcessOperators } from './ProcessOperators.js';
2
+ import type { FetchRequest } from '../client/index.js';
3
3
  /**
4
4
  * Extends the `ProcessOperators` class to handle HTTP requests.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { ProcessOperators } from './ProcessOperators';
1
+ import { ProcessOperators } from './ProcessOperators.js';
2
2
  /**
3
3
  * The `HttpResponseHandler` class extends the `ProcessOperators` class and is responsible for handling HTTP responses.
4
4
  * It provides a common interface for processing HTTP responses, allowing for consistent error handling and response transformation.
@@ -1,5 +1,5 @@
1
1
  import type { Observable } from 'rxjs';
2
- import type { IProcessOperators, ProcessOperator } from './types';
2
+ import type { IProcessOperators, ProcessOperator } from './types.js';
3
3
  /**
4
4
  * ProcessOperators class manages a collection of process operators
5
5
  * and provides methods to add, set, get, and process these operators.
@@ -1,4 +1,4 @@
1
- import type { ProcessOperator } from './types';
1
+ import type { ProcessOperator } from './types.js';
2
2
  /**
3
3
  * Ensures that the HTTP method of the given request is in uppercase.
4
4
  *
@@ -51,7 +51,7 @@ export declare const requestInitSchema: z.ZodObject<{
51
51
  eventSourceEligible: z.ZodOptional<z.ZodBoolean>;
52
52
  triggerEligible: z.ZodOptional<z.ZodBoolean>;
53
53
  }, z.core.$strip>>;
54
- body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Blob, Blob>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<FormData, FormData>, z.ZodCustom<URLSearchParams, URLSearchParams>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>]>>;
54
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Blob>, z.ZodInstanceOf<ArrayBuffer>, z.ZodInstanceOf<FormData>, z.ZodInstanceOf<URLSearchParams>, z.ZodInstanceOf<ReadableStream<unknown>>]>>;
55
55
  browsingTopics: z.ZodOptional<z.ZodBoolean>;
56
56
  cache: z.ZodOptional<z.ZodEnum<{
57
57
  default: "default";
@@ -66,7 +66,7 @@ export declare const requestInitSchema: z.ZodObject<{
66
66
  omit: "omit";
67
67
  "same-origin": "same-origin";
68
68
  }>>;
69
- headers: z.ZodUnion<[z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodCustom<Headers, Headers>]>;
69
+ headers: z.ZodUnion<[z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodInstanceOf<Headers>]>;
70
70
  integrity: z.ZodOptional<z.ZodString>;
71
71
  keepalive: z.ZodOptional<z.ZodBoolean>;
72
72
  method: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
@@ -108,7 +108,7 @@ export declare const requestInitSchema: z.ZodObject<{
108
108
  "strict-origin-when-cross-origin": "strict-origin-when-cross-origin";
109
109
  "unsafe-url": "unsafe-url";
110
110
  }>>;
111
- signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
111
+ signal: z.ZodOptional<z.ZodInstanceOf<AbortSignal>>;
112
112
  }, z.core.$strip>;
113
113
  /**
114
114
  * Schema for validating fetch request configurations.
@@ -122,7 +122,7 @@ export declare const fetchRequestSchema: z.ZodObject<{
122
122
  eventSourceEligible: z.ZodOptional<z.ZodBoolean>;
123
123
  triggerEligible: z.ZodOptional<z.ZodBoolean>;
124
124
  }, z.core.$strip>>;
125
- body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Blob, Blob>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<FormData, FormData>, z.ZodCustom<URLSearchParams, URLSearchParams>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>]>>;
125
+ body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Blob>, z.ZodInstanceOf<ArrayBuffer>, z.ZodInstanceOf<FormData>, z.ZodInstanceOf<URLSearchParams>, z.ZodInstanceOf<ReadableStream<unknown>>]>>;
126
126
  browsingTopics: z.ZodOptional<z.ZodBoolean>;
127
127
  cache: z.ZodOptional<z.ZodEnum<{
128
128
  default: "default";
@@ -137,7 +137,7 @@ export declare const fetchRequestSchema: z.ZodObject<{
137
137
  omit: "omit";
138
138
  "same-origin": "same-origin";
139
139
  }>>;
140
- headers: z.ZodUnion<[z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodCustom<Headers, Headers>]>;
140
+ headers: z.ZodUnion<[z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodInstanceOf<Headers>]>;
141
141
  integrity: z.ZodOptional<z.ZodString>;
142
142
  keepalive: z.ZodOptional<z.ZodBoolean>;
143
143
  method: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
@@ -179,7 +179,7 @@ export declare const fetchRequestSchema: z.ZodObject<{
179
179
  "strict-origin-when-cross-origin": "strict-origin-when-cross-origin";
180
180
  "unsafe-url": "unsafe-url";
181
181
  }>>;
182
- signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
182
+ signal: z.ZodOptional<z.ZodInstanceOf<AbortSignal>>;
183
183
  uri: z.ZodString;
184
184
  path: z.ZodOptional<z.ZodString>;
185
185
  }, z.core.$strip>;
@@ -1,8 +1,8 @@
1
- export { HttpRequestHandler } from './HttpRequestHandler';
2
- export { HttpResponseHandler } from './HttpResponseHandler';
3
- export { HttpMiddlewareHandler } from './HttpMiddlewareHandler';
4
- export { ProcessOperators } from './ProcessOperators';
5
- export { capitalizeRequestMethodOperator } from './capitalize-request-method-operator';
6
- export { requestValidationOperator } from './request-validation-operator';
7
- export { sseMap } from './sse-map.operator';
8
- export * from './types';
1
+ export { HttpRequestHandler } from './HttpRequestHandler.js';
2
+ export { HttpResponseHandler } from './HttpResponseHandler.js';
3
+ export { HttpMiddlewareHandler } from './HttpMiddlewareHandler.js';
4
+ export { ProcessOperators } from './ProcessOperators.js';
5
+ export { capitalizeRequestMethodOperator } from './capitalize-request-method-operator.js';
6
+ export { requestValidationOperator } from './request-validation-operator.js';
7
+ export { sseMap } from './sse-map.operator.js';
8
+ export * from './types.js';
@@ -1,5 +1,5 @@
1
- import type { FetchRequest } from '../client';
2
- import type { ProcessOperator } from './types';
1
+ import type { FetchRequest } from '../client/index.js';
2
+ import type { ProcessOperator } from './types.js';
3
3
  /**
4
4
  * Creates a process operator that adds a header to the request.
5
5
  *
@@ -1,5 +1,5 @@
1
- import type { ProcessOperator } from './types';
2
- import type { FetchRequest } from '../client/types';
1
+ import type { ProcessOperator } from './types.js';
2
+ import type { FetchRequest } from '../client/types.js';
3
3
  /**
4
4
  * Validates the given request using the `requestInitSchema`.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { OperatorFunction } from 'rxjs';
2
- import { type ServerSentEvent, type SseSelectorOptions } from '../selectors/create-sse-selector';
2
+ import { type ServerSentEvent, type SseSelectorOptions } from '../selectors/create-sse-selector.js';
3
3
  /**
4
4
  * An operator function for handling Server-Sent Events (SSE) in an RxJS pipeline.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Observable, ObservableInput } from 'rxjs';
2
- import type { FetchRequest } from '../client';
2
+ import type { FetchRequest } from '../client/index.js';
3
3
  /**
4
4
  * A process operator that takes a request of type `T` and returns a transformed request of type `R`, or `void`, or a Promise that resolves to `R` or `void`.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { ResponseSelector } from '../client/types';
1
+ import type { ResponseSelector } from '../client/types.js';
2
2
  /**
3
3
  * Extracts a blob and filename from a successful HTTP response.
4
4
  *
@@ -1,5 +1,5 @@
1
- export { jsonSelector } from './json-selector';
2
- export { blobSelector } from './blob-selector';
3
- export { createSseSelector } from './create-sse-selector';
4
- export type { ResponseSelector } from '../client/types';
5
- export type { DataParser, ServerSentEvent, SseSelector, SseSelectorOptions, } from './create-sse-selector';
1
+ export { jsonSelector } from './json-selector.js';
2
+ export { blobSelector } from './blob-selector.js';
3
+ export { createSseSelector } from './create-sse-selector.js';
4
+ export type { ResponseSelector } from '../client/types.js';
5
+ export type { DataParser, ServerSentEvent, SseSelector, SseSelectorOptions, } from './create-sse-selector.js';
@@ -1,4 +1,4 @@
1
- import type { ResponseSelector } from '../client/types';
1
+ import type { ResponseSelector } from '../client/types.js';
2
2
  /**
3
3
  * Asynchronously parses the JSON data from a given HTTP response.
4
4
  *
@@ -1,5 +1,5 @@
1
- import type { HttpMiddleware } from '../lib/operators/types';
2
- import { type OpenApiMockLike } from './resolve-open-api-mock-response';
1
+ import type { HttpMiddleware } from '../lib/operators/types.js';
2
+ import { type OpenApiMockLike } from './resolve-open-api-mock-response.js';
3
3
  /**
4
4
  * Adapts an `OpenApiMock` into an {@link HttpMiddleware}, so
5
5
  * `configurator.http.addMiddleware(...)` fakes every matching request
@@ -1,4 +1,4 @@
1
- import type { HttpMiddleware } from '../lib/operators/types';
1
+ import type { HttpMiddleware } from '../lib/operators/types.js';
2
2
  /**
3
3
  * A route match handed to a {@link MockRouteHandler} once its pattern has matched a request.
4
4
  */
@@ -15,6 +15,6 @@
15
15
  *
16
16
  * @packageDocumentation
17
17
  */
18
- export { createOpenApiMockMiddleware } from './create-open-api-mock-middleware';
19
- export type { OpenApiMockLike } from './resolve-open-api-mock-response';
20
- export { createRouterMiddleware, type MockRouteHandler, type MockRouteMatch, type IMockRouterBuilder, } from './create-router-middleware';
18
+ export { createOpenApiMockMiddleware } from './create-open-api-mock-middleware.js';
19
+ export type { OpenApiMockLike } from './resolve-open-api-mock-response.js';
20
+ export { createRouterMiddleware, type MockRouteHandler, type MockRouteMatch, type IMockRouterBuilder, } from './create-router-middleware.js';
@@ -1,6 +1,6 @@
1
- import { HttpClientMsal } from './lib/client';
2
- import { type IHttpClientConfigurator, type HttpClientOptions } from './configurator';
3
- import { type IHttpClientProvider } from './provider';
1
+ import { HttpClientMsal } from './lib/client/index.js';
2
+ import { type IHttpClientConfigurator, type HttpClientOptions } from './configurator.js';
3
+ import { type IHttpClientProvider } from './provider.js';
4
4
  import type { Module, ModuleConfigType, IModuleConfigurator } from '@equinor/fusion-framework-module';
5
5
  import type { MsalModule } from '@equinor/fusion-framework-module-msal';
6
6
  /**
@@ -1,7 +1,7 @@
1
- import type { HttpClient } from './lib/client';
2
- import type { HttpClientOptions, HttpClientRequestInitType, IHttpClientConfigurator } from './configurator';
3
- import type { IHttpMiddlewareHandler, IHttpRequestHandler } from './lib/operators';
4
- import type { IHttpClient } from './lib/client';
1
+ import type { HttpClient } from './lib/client/index.js';
2
+ import type { HttpClientOptions, HttpClientRequestInitType, IHttpClientConfigurator } from './configurator.js';
3
+ import type { IHttpMiddlewareHandler, IHttpRequestHandler } from './lib/operators/index.js';
4
+ import type { IHttpClient } from './lib/client/index.js';
5
5
  import { BaseModuleProvider } from '@equinor/fusion-framework-module/provider';
6
6
  /**
7
7
  * Creates fresh HTTP client instances from named or ad-hoc configuration.
@@ -1 +1 @@
1
- export declare const version = "8.1.1";
1
+ export declare const version = "8.1.3";
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-http",
3
- "version": "8.1.1",
3
+ "version": "8.1.3",
4
4
  "description": "",
5
+ "type": "module",
5
6
  "main": "dist/esm/index.js",
6
7
  "types": "dist/types/index.d.ts",
7
8
  "exports": {
@@ -67,16 +68,17 @@
67
68
  "directory": "packages/modules/http"
68
69
  },
69
70
  "dependencies": {
71
+ "@equinor/fusion-framework-module": "^6.1.5",
72
+ "@equinor/fusion-framework-module-msal": "^12.0.1",
70
73
  "rxjs": "^7.8.1",
71
- "zod": "^4.4.3",
72
- "@equinor/fusion-framework-module": "^6.1.4",
73
- "@equinor/fusion-framework-module-msal": "^11.0.1"
74
+ "zod": "^4.4.3"
74
75
  },
75
76
  "devDependencies": {
76
77
  "typescript": "^7.0.2",
77
78
  "vitest": "^4.1.10"
78
79
  },
79
80
  "scripts": {
81
+ "prebuild": "node ../../../.github/scripts/generate-versions.mjs",
80
82
  "build": "tsc -b",
81
83
  "test": "vitest"
82
84
  }