@equinor/fusion-framework-module-http 0.0.0-next-20230915111233

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 (87) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +427 -0
  3. package/LICENSE +21 -0
  4. package/README.md +57 -0
  5. package/dist/esm/configurator.js +22 -0
  6. package/dist/esm/configurator.js.map +1 -0
  7. package/dist/esm/errors.js +8 -0
  8. package/dist/esm/errors.js.map +1 -0
  9. package/dist/esm/index.js +6 -0
  10. package/dist/esm/index.js.map +1 -0
  11. package/dist/esm/lib/client/client-msal.js +15 -0
  12. package/dist/esm/lib/client/client-msal.js.map +1 -0
  13. package/dist/esm/lib/client/client.js +108 -0
  14. package/dist/esm/lib/client/client.js.map +1 -0
  15. package/dist/esm/lib/client/index.js +4 -0
  16. package/dist/esm/lib/client/index.js.map +1 -0
  17. package/dist/esm/lib/client/types.js +2 -0
  18. package/dist/esm/lib/client/types.js.map +1 -0
  19. package/dist/esm/lib/index.js +4 -0
  20. package/dist/esm/lib/index.js.map +1 -0
  21. package/dist/esm/lib/operators/http-request-handler.js +10 -0
  22. package/dist/esm/lib/operators/http-request-handler.js.map +1 -0
  23. package/dist/esm/lib/operators/http-response-handler.js +5 -0
  24. package/dist/esm/lib/operators/http-response-handler.js.map +1 -0
  25. package/dist/esm/lib/operators/index.js +5 -0
  26. package/dist/esm/lib/operators/index.js.map +1 -0
  27. package/dist/esm/lib/operators/process-operators.js +27 -0
  28. package/dist/esm/lib/operators/process-operators.js.map +1 -0
  29. package/dist/esm/lib/operators/request-operator-header.js +7 -0
  30. package/dist/esm/lib/operators/request-operator-header.js.map +1 -0
  31. package/dist/esm/lib/operators/types.js +2 -0
  32. package/dist/esm/lib/operators/types.js.map +1 -0
  33. package/dist/esm/lib/selectors/blob-selector.js +16 -0
  34. package/dist/esm/lib/selectors/blob-selector.js.map +1 -0
  35. package/dist/esm/lib/selectors/index.js +3 -0
  36. package/dist/esm/lib/selectors/index.js.map +1 -0
  37. package/dist/esm/lib/selectors/json-selector.js +16 -0
  38. package/dist/esm/lib/selectors/json-selector.js.map +1 -0
  39. package/dist/esm/module.js +48 -0
  40. package/dist/esm/module.js.map +1 -0
  41. package/dist/esm/provider.js +51 -0
  42. package/dist/esm/provider.js.map +1 -0
  43. package/dist/esm/version.js +2 -0
  44. package/dist/esm/version.js.map +1 -0
  45. package/dist/tsconfig.tsbuildinfo +1 -0
  46. package/dist/types/configurator.d.ts +37 -0
  47. package/dist/types/errors.d.ts +5 -0
  48. package/dist/types/index.d.ts +6 -0
  49. package/dist/types/lib/client/client-msal.d.ts +12 -0
  50. package/dist/types/lib/client/client.d.ts +34 -0
  51. package/dist/types/lib/client/index.d.ts +3 -0
  52. package/dist/types/lib/client/types.d.ts +36 -0
  53. package/dist/types/lib/index.d.ts +3 -0
  54. package/dist/types/lib/operators/http-request-handler.d.ts +6 -0
  55. package/dist/types/lib/operators/http-response-handler.d.ts +4 -0
  56. package/dist/types/lib/operators/index.d.ts +4 -0
  57. package/dist/types/lib/operators/process-operators.d.ts +9 -0
  58. package/dist/types/lib/operators/request-operator-header.d.ts +4 -0
  59. package/dist/types/lib/operators/types.d.ts +14 -0
  60. package/dist/types/lib/selectors/blob-selector.d.ts +2 -0
  61. package/dist/types/lib/selectors/index.d.ts +2 -0
  62. package/dist/types/lib/selectors/json-selector.d.ts +2 -0
  63. package/dist/types/module.d.ts +18 -0
  64. package/dist/types/provider.d.ts +23 -0
  65. package/dist/types/version.d.ts +1 -0
  66. package/package.json +51 -0
  67. package/src/configurator.ts +131 -0
  68. package/src/errors.ts +9 -0
  69. package/src/index.ts +14 -0
  70. package/src/lib/client/client-msal.ts +33 -0
  71. package/src/lib/client/client.ts +204 -0
  72. package/src/lib/client/index.ts +4 -0
  73. package/src/lib/client/types.ts +168 -0
  74. package/src/lib/index.ts +3 -0
  75. package/src/lib/operators/http-request-handler.ts +21 -0
  76. package/src/lib/operators/http-response-handler.ts +5 -0
  77. package/src/lib/operators/index.ts +5 -0
  78. package/src/lib/operators/process-operators.ts +43 -0
  79. package/src/lib/operators/request-operator-header.ts +12 -0
  80. package/src/lib/operators/types.ts +42 -0
  81. package/src/lib/selectors/blob-selector.ts +19 -0
  82. package/src/lib/selectors/index.ts +2 -0
  83. package/src/lib/selectors/json-selector.ts +19 -0
  84. package/src/module.ts +80 -0
  85. package/src/provider.ts +98 -0
  86. package/src/version.ts +2 -0
  87. package/tsconfig.json +24 -0
@@ -0,0 +1,4 @@
1
+
2
+ > @equinor/fusion-framework-module-http@5.0.6 build /Users/odin.rochmann/dev/tmp/fusion-framework/packages/modules/http
3
+ > tsc -b
4
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,427 @@
1
+ # Change Log
2
+
3
+ ## 0.0.0-next-20230915111233
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1242](https://github.com/equinor/fusion-framework/pull/1242) [`8e9e34a06`](https://github.com/equinor/fusion-framework/commit/8e9e34a06a6905d092ad8ca3f9330a3699da20fa) Thanks [@odinr](https://github.com/odinr)! - add method for executing blob requests
8
+
9
+ - added selector for extracting blob from response
10
+ - added function for fetching blob as stream or promise on the http client
11
+
12
+ ```tsx
13
+ const data = await client.blob('/person/photo');
14
+ const url = URL.createObjectURL(blob);
15
+ return <img src={url} />;
16
+ ```
17
+
18
+ ## 5.0.6
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`9076a498`](https://github.com/equinor/fusion-framework/commit/9076a49876e7a414a27557b7fb9095a67fe3a57f)]:
23
+ - @equinor/fusion-framework-module@4.2.4
24
+ - @equinor/fusion-framework-module-msal@3.0.6
25
+
26
+ ## 5.0.5
27
+
28
+ ### Patch Changes
29
+
30
+ - [#1109](https://github.com/equinor/fusion-framework/pull/1109) [`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862) Thanks [@odinr](https://github.com/odinr)! - Change packaged manager from yarn to pnpm
31
+
32
+ conflicts of `@types/react` made random outcomes when using `yarn`
33
+
34
+ this change should not affect consumer of the packages, but might conflict dependent on local package manager.
35
+
36
+ - [#1145](https://github.com/equinor/fusion-framework/pull/1145) [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump rxjs from 7.5.7 to [7.8.1](https://github.com/ReactiveX/rxjs/blob/7.8.1/CHANGELOG.md)
37
+
38
+ - [#1163](https://github.com/equinor/fusion-framework/pull/1163) [`52d98701`](https://github.com/equinor/fusion-framework/commit/52d98701627e93c7284c0b9a5bfd8dab1da43bd3) Thanks [@odinr](https://github.com/odinr)! - Append `Accecpt: application/json` to request headers
39
+
40
+ when using the `json# Change Log or `json`function on the`HttpClient`add`Accecpt: application/json` to the request header
41
+
42
+ - Updated dependencies [[`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862), [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272)]:
43
+ - @equinor/fusion-framework-module@4.2.3
44
+ - @equinor/fusion-framework-module-msal@3.0.5
45
+
46
+ ## 5.0.4
47
+
48
+ ### Patch Changes
49
+
50
+ - [#946](https://github.com/equinor/fusion-framework/pull/946) [`5a160d88`](https://github.com/equinor/fusion-framework/commit/5a160d88981ddfe861d391cfefe10f54dda3d352) Thanks [@odinr](https://github.com/odinr)! - Build/update typescript to 5
51
+
52
+ - Updated dependencies [[`5a160d88`](https://github.com/equinor/fusion-framework/commit/5a160d88981ddfe861d391cfefe10f54dda3d352)]:
53
+ - @equinor/fusion-framework-module@4.2.1
54
+ - @equinor/fusion-framework-module-msal@3.0.4
55
+
56
+ ## 5.0.3
57
+
58
+ ### Patch Changes
59
+
60
+ - [#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**
61
+
62
+ - align all versions of typescript
63
+ - update types to build
64
+ - 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
65
+
66
+ - Updated dependencies [[`3efbf0bb`](https://github.com/equinor/fusion-framework/commit/3efbf0bb93fc11aa158872cd6ab98a22bcfb59e5), [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9), [`76b30c1e`](https://github.com/equinor/fusion-framework/commit/76b30c1e86db3db18adbe759bb1e39885de1c898), [`83ee5abf`](https://github.com/equinor/fusion-framework/commit/83ee5abf7bcab193c85980e5ae44895cd7f6f08d), [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9), [`060818eb`](https://github.com/equinor/fusion-framework/commit/060818eb04ebb9ed6deaed1f0b4530201b1181cf), [`3efbf0bb`](https://github.com/equinor/fusion-framework/commit/3efbf0bb93fc11aa158872cd6ab98a22bcfb59e5), [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c)]:
67
+ - @equinor/fusion-framework-module@4.2.0
68
+ - @equinor/fusion-framework-module-msal@3.0.3
69
+
70
+ All notable changes to this project will be documented in this file.
71
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
72
+
73
+ ## 5.0.2 (2023-05-23)
74
+
75
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
76
+
77
+ ## 5.0.1 (2023-05-05)
78
+
79
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
80
+
81
+ ## 5.0.0 (2023-04-16)
82
+
83
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
84
+
85
+ ## 4.0.2 (2023-03-22)
86
+
87
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
88
+
89
+ ## [4.0.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@4.0.0...@equinor/fusion-framework-module-http@4.0.1) (2023-03-20)
90
+
91
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
92
+
93
+ ## 4.0.0 (2023-02-22)
94
+
95
+ ### ⚠ BREAKING CHANGES
96
+
97
+ - **modules/http:** `IHttpClient.execute` is removed, most likely not used, too complex to maintain
98
+
99
+ ### Bug Fixes
100
+
101
+ - **modules/http:** fix typing for json requests ([459df80](https://github.com/equinor/fusion-framework/commit/459df80bfc79426ec6507db8f06d488b6a3d0f07))
102
+
103
+ ## [3.0.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.2.3...@equinor/fusion-framework-module-http@3.0.0) (2023-01-27)
104
+
105
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
106
+
107
+ ## [3.0.0-alpha.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.2.3...@equinor/fusion-framework-module-http@3.0.0-alpha.0) (2023-01-26)
108
+
109
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
110
+
111
+ ## 2.2.3 (2023-01-26)
112
+
113
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
114
+
115
+ ## 2.2.2 (2023-01-17)
116
+
117
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
118
+
119
+ ## 2.2.1 (2022-12-12)
120
+
121
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
122
+
123
+ ## [2.2.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.1.8...@equinor/fusion-framework-module-http@2.2.0) (2022-12-08)
124
+
125
+ ### Features
126
+
127
+ - **http:** throw error when selector error ([dc0aa35](https://github.com/equinor/fusion-framework/commit/dc0aa35cbc44fb0503a9431ab728b81d8a3af290))
128
+
129
+ ## 2.1.8 (2022-12-06)
130
+
131
+ ### Bug Fixes
132
+
133
+ - **module-http:** adding missing types on module-http iHttpClient ([ac6e81e](https://github.com/equinor/fusion-framework/commit/ac6e81e54d70b8a943466046fcbe86f6bd7c4c67))
134
+
135
+ ## 2.1.7 (2022-12-01)
136
+
137
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
138
+
139
+ ## 2.1.6 (2022-12-01)
140
+
141
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
142
+
143
+ ## 2.1.5 (2022-11-18)
144
+
145
+ ### Bug Fixes
146
+
147
+ - **module-http:** add headers to json request ([8223394](https://github.com/equinor/fusion-framework/commit/8223394362a24663bf65442025f0b031aa37a910))
148
+
149
+ ## 2.1.4 (2022-11-11)
150
+
151
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
152
+
153
+ ## 2.1.3 (2022-11-11)
154
+
155
+ ### Bug Fixes
156
+
157
+ - **module-auth:** make http module await auth ([18a0ed9](https://github.com/equinor/fusion-framework/commit/18a0ed947e128bf1cdc86aa45d31e73c1f8c4bbb))
158
+
159
+ ## 2.1.2 (2022-11-03)
160
+
161
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
162
+
163
+ ## 2.1.1 (2022-11-02)
164
+
165
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
166
+
167
+ ## 2.1.0 (2022-11-01)
168
+
169
+ ### Features
170
+
171
+ - :necktie: remove try catch from json-selector ([fe5e2ea](https://github.com/equinor/fusion-framework/commit/fe5e2ea087cdee99403175e912eb09479b86414e))
172
+ - :sparkles: return undefined on status code 204 ([af1eea7](https://github.com/equinor/fusion-framework/commit/af1eea7a9ef539a44c3cab69904b4764f169caa6))
173
+
174
+ ### Reverts
175
+
176
+ - :rewind: revert changes in json-selector ([8c448e5](https://github.com/equinor/fusion-framework/commit/8c448e5c76fb20cbd908c95f2fbd9d8d0367aad1))
177
+
178
+ ## 2.0.14 (2022-10-27)
179
+
180
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
181
+
182
+ ## 2.0.13 (2022-10-21)
183
+
184
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
185
+
186
+ ## [2.0.12](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.11...@equinor/fusion-framework-module-http@2.0.12) (2022-10-17)
187
+
188
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
189
+
190
+ ## 2.0.11 (2022-10-03)
191
+
192
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
193
+
194
+ ## 2.0.10 (2022-10-03)
195
+
196
+ ### Bug Fixes
197
+
198
+ - **module-http:** allow typing of fetch request ([de08783](https://github.com/equinor/fusion-framework/commit/de0878342d82249ffc7e1212230d0aa0e14d32cb))
199
+
200
+ ## [2.0.9](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.8...@equinor/fusion-framework-module-http@2.0.9) (2022-09-29)
201
+
202
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
203
+
204
+ ## 2.0.8 (2022-09-27)
205
+
206
+ ### Bug Fixes
207
+
208
+ - update registering of configuration ([20942ce](https://github.com/equinor/fusion-framework/commit/20942ce1c7a853ea3b55c031a242646e378db8c9))
209
+
210
+ ## 2.0.7 (2022-09-20)
211
+
212
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
213
+
214
+ ## [2.0.6](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.5...@equinor/fusion-framework-module-http@2.0.6) (2022-09-16)
215
+
216
+ ### Bug Fixes
217
+
218
+ - **module-http:** fix export ([06a490d](https://github.com/equinor/fusion-framework/commit/06a490d40e34d2074ac102ac4fcd458cadd3538a))
219
+ - **module-http:** improve hierarchy ([3603347](https://github.com/equinor/fusion-framework/commit/36033474991288983490f250726a551f7ce3dcbd))
220
+
221
+ ## [2.0.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.4...@equinor/fusion-framework-module-http@2.0.5) (2022-09-14)
222
+
223
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
224
+
225
+ ## [2.0.4](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.3...@equinor/fusion-framework-module-http@2.0.4) (2022-09-13)
226
+
227
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
228
+
229
+ ## [2.0.3](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.2...@equinor/fusion-framework-module-http@2.0.3) (2022-09-13)
230
+
231
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
232
+
233
+ ## [2.0.2](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.1...@equinor/fusion-framework-module-http@2.0.2) (2022-09-13)
234
+
235
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
236
+
237
+ ## [2.0.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.1-next.1...@equinor/fusion-framework-module-http@2.0.1) (2022-09-12)
238
+
239
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
240
+
241
+ ## [2.0.1-next.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.1-next.0...@equinor/fusion-framework-module-http@2.0.1-next.1) (2022-09-12)
242
+
243
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
244
+
245
+ ## [2.0.1-next.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@2.0.0...@equinor/fusion-framework-module-http@2.0.1-next.0) (2022-09-12)
246
+
247
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
248
+
249
+ ## 2.0.0 (2022-09-12)
250
+
251
+ ### Features
252
+
253
+ - **module-http:** expose simple config ([94e4d6b](https://github.com/equinor/fusion-framework/commit/94e4d6bbb7fef010cd72e49242d68ed155592e11))
254
+
255
+ ## [2.0.0-alpha.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@1.0.2...@equinor/fusion-framework-module-http@2.0.0-alpha.0) (2022-09-12)
256
+
257
+ ### Features
258
+
259
+ - **module-http:** expose simple config ([94e4d6b](https://github.com/equinor/fusion-framework/commit/94e4d6bbb7fef010cd72e49242d68ed155592e11))
260
+
261
+ ## 1.0.2 (2022-09-05)
262
+
263
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
264
+
265
+ ## 1.0.1 (2022-09-05)
266
+
267
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
268
+
269
+ ## 1.0.0 (2022-08-29)
270
+
271
+ ### ⚠ BREAKING CHANGES
272
+
273
+ - rename fetch
274
+
275
+ - fix(module-service-discovery): update http client consumer
276
+
277
+ - build: update allowed branches
278
+
279
+ - build: add conventional commit
280
+
281
+ - build: use conventionalcommits
282
+
283
+ - build(module-http): push major
284
+
285
+ - build: update deps
286
+
287
+ ### Features
288
+
289
+ - rename fetch method ([#226](https://github.com/equinor/fusion-framework/issues/226)) ([f02df7c](https://github.com/equinor/fusion-framework/commit/f02df7cdd2b9098b0da49c5ea56ac3b6a17e9e32))
290
+
291
+ ## 0.6.2 (2022-08-19)
292
+
293
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
294
+
295
+ ## [0.6.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.6.0...@equinor/fusion-framework-module-http@0.6.1) (2022-08-15)
296
+
297
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
298
+
299
+ # [0.6.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.5.0...@equinor/fusion-framework-module-http@0.6.0) (2022-08-11)
300
+
301
+ - feat!: allow modules to displose ([32b69fb](https://github.com/equinor/fusion-framework/commit/32b69fb7cc61e78e503e67d0e77f21fb44b600b9))
302
+
303
+ ### BREAKING CHANGES
304
+
305
+ - module.initialize now has object as arg
306
+
307
+ # 0.5.0 (2022-08-08)
308
+
309
+ ### Bug Fixes
310
+
311
+ - **module-http:** expose FetchRequest ([3d14ead](https://github.com/equinor/fusion-framework/commit/3d14ead0d78b36db091c6645ff1b69101e1f911f))
312
+
313
+ ### Features
314
+
315
+ - **module-service-discovery:** resolve service to config ([3fa088d](https://github.com/equinor/fusion-framework/commit/3fa088d2ced8136447df6949928f1af9fc83407a))
316
+
317
+ # [0.4.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.10...@equinor/fusion-framework-module-http@0.4.0) (2022-08-04)
318
+
319
+ - feat(module)!: allow requireing module instnce (#190) ([3a7e67e](https://github.com/equinor/fusion-framework/commit/3a7e67e9accb5185100325c92d5850a44626e498)), closes [#190](https://github.com/equinor/fusion-framework/issues/190)
320
+
321
+ ### BREAKING CHANGES
322
+
323
+ - `deps` prop is remove from module object, use `await require('MODULE')`;
324
+
325
+ - feat(module)!: allow requireing module instnce
326
+
327
+ when module initiates it should be allowed to await an required module.
328
+
329
+ - add method for awaiting required module
330
+ - add typing for config in initialize fase
331
+
332
+ - update service discovery to await http module
333
+ - add service discovery client
334
+ - allow configuration of service discovery client
335
+
336
+ * `deps` prop is remove from module object, use `await require('MODULE')`;
337
+
338
+ * fix(module-http): add default interface for HttpClientOptions
339
+
340
+ ## [0.3.10](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.9...@equinor/fusion-framework-module-http@0.3.10) (2022-08-01)
341
+
342
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
343
+
344
+ ## 0.3.9 (2022-08-01)
345
+
346
+ ### Bug Fixes
347
+
348
+ - change typo of exports ([b049503](https://github.com/equinor/fusion-framework/commit/b049503511fb1b37b920b00aed1468ed8385a67e))
349
+
350
+ ## [0.3.8](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.7...@equinor/fusion-framework-module-http@0.3.8) (2022-07-01)
351
+
352
+ ### Bug Fixes
353
+
354
+ - **module-http:** fix selector of client ([dcc4774](https://github.com/equinor/fusion-framework/commit/dcc477489b51aa988a97494ff553eee34404469d))
355
+
356
+ ## [0.3.7](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.6...@equinor/fusion-framework-module-http@0.3.7) (2022-07-01)
357
+
358
+ ### Bug Fixes
359
+
360
+ - **module-http:** make rxjs dependent ([a20286f](https://github.com/equinor/fusion-framework/commit/a20286f950ff10c84605c025354cb05280c7455a))
361
+
362
+ ## [0.3.6](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.5...@equinor/fusion-framework-module-http@0.3.6) (2022-06-30)
363
+
364
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
365
+
366
+ ## [0.3.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.4...@equinor/fusion-framework-module-http@0.3.5) (2022-06-30)
367
+
368
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
369
+
370
+ ## [0.3.4](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.3...@equinor/fusion-framework-module-http@0.3.4) (2022-06-28)
371
+
372
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
373
+
374
+ ## [0.3.3](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.2...@equinor/fusion-framework-module-http@0.3.3) (2022-06-28)
375
+
376
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
377
+
378
+ ## [0.3.2](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-http@0.3.1...@equinor/fusion-framework-module-http@0.3.2) (2022-06-28)
379
+
380
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
381
+
382
+ ## 0.3.1 (2022-06-28)
383
+
384
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
385
+
386
+ # 0.3.0 (2022-06-14)
387
+
388
+ ### Features
389
+
390
+ - **module-http:** expose response processor ([e4551c5](https://github.com/equinor/fusion-framework/commit/e4551c549654ef25f33eef72ebc2fcc02ab552a2))
391
+
392
+ ## 0.2.2 (2022-06-13)
393
+
394
+ ### Bug Fixes
395
+
396
+ - **module-http:** reutrn fallb ack config ([8ece469](https://github.com/equinor/fusion-framework/commit/8ece469e99bd64c10a7697d49fdcc5d396737ac8))
397
+
398
+ ## 0.2.1 (2022-06-10)
399
+
400
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
401
+
402
+ # 0.2.0 (2022-05-31)
403
+
404
+ ### Features
405
+
406
+ - **module-http:** add json support ([a6adbbb](https://github.com/equinor/fusion-framework/commit/a6adbbb36ca1391f8813be6141ef963031098764))
407
+
408
+ ## 0.1.1 (2022-02-09)
409
+
410
+ **Note:** Version bump only for package @equinor/fusion-framework-module-http
411
+
412
+ # 0.1.0 (2022-02-07)
413
+
414
+ ### Bug Fixes
415
+
416
+ - expose http client interface ([8660822](https://github.com/equinor/fusion-framework/commit/8660822b669e549bd454aa8a6a0adcaeb5e7917f))
417
+ - **module-http:** allow defaultScopes ([d476de9](https://github.com/equinor/fusion-framework/commit/d476de99e6289e60684f02bcd7b669e23f3789bb))
418
+ - **module-http:** fix check if config when creating client ([950ebc1](https://github.com/equinor/fusion-framework/commit/950ebc18f8f35bb7e6f97d6a98bd91d87616a94e))
419
+ - **module-http:** fix merge of process operators ([5a1d6d2](https://github.com/equinor/fusion-framework/commit/5a1d6d2942475c61c994f4ec26812c949cabbdf1))
420
+ - **module-http:** fix relative url resolve ([0d8c311](https://github.com/equinor/fusion-framework/commit/0d8c311c66b52eec22d465e0db57fa003506ab0c))
421
+
422
+ ### Features
423
+
424
+ - add module for http clients ([7b02db7](https://github.com/equinor/fusion-framework/commit/7b02db7c2e34b97659bc72af7b5b31307cf55e5f))
425
+ - http client base uri ([233cabf](https://github.com/equinor/fusion-framework/commit/233cabfea0f2b07955670e553472427ec27a3aa0))
426
+ - **module-http:** add check for registered client keys ([93b42f8](https://github.com/equinor/fusion-framework/commit/93b42f88ad092e24fe4f1a216394893128d35734))
427
+ - **module-http:** allow selector for http requests ([ea300c8](https://github.com/equinor/fusion-framework/commit/ea300c8ad5555e4514b35ac43a4c8494461afd91))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Equinor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ ## Configure
2
+
3
+ Module for configuring and providing http clients
4
+
5
+ ### Simple
6
+ ```ts
7
+ const configure = (config) => {
8
+ config.http.configureClient(
9
+ 'bar',
10
+ 'https://somewhere-test.com'
11
+ );
12
+ }
13
+ ```
14
+
15
+ ### Standard
16
+ ```ts
17
+ const configure = (config) => {
18
+ config.http.configureClient(
19
+ 'bar',
20
+ {
21
+ baseUri: 'https://foo.bar',
22
+ defaultScopes: ['foobar/.default']
23
+ }
24
+ );
25
+ }
26
+ ```
27
+
28
+ ### Callback
29
+ ```ts
30
+ const configure = async(config) => {
31
+ config.http.configureClient(
32
+ 'bar',
33
+ (client): => {
34
+ client.uri = 'https://foo.bar'
35
+ client.defaultScopes: ['foobar/.default']
36
+ }
37
+ );
38
+ }
39
+ ```
40
+
41
+ ## Consumption
42
+ ```ts
43
+ const client = modules.http.createClient('foo');
44
+ const selector = (response: Response): Promise<FooBar> => response.json();
45
+ // stream
46
+ client.fetch('/api/admin', {selector, scopes: ['foobar/.admin']}).subscribe(x => console.log(x));
47
+ // async
48
+ client.fetchAsync('/api', {selector}).then(console.log);
49
+ ```
50
+
51
+ ## Operators
52
+ ```ts
53
+ const client = modules.http.createClient('foo');
54
+ const logger = console.debug;
55
+ client.requestHandler.add((x: Request) => logger(x));
56
+ client.responseHandler.add((x: Request) => logger(x));
57
+ ```
@@ -0,0 +1,22 @@
1
+ import { HttpRequestHandler } from './lib/operators';
2
+ export class HttpClientConfigurator {
3
+ get clients() {
4
+ return Object.assign({}, this._clients);
5
+ }
6
+ constructor(client) {
7
+ this._clients = {};
8
+ this.defaultHttpRequestHandler = new HttpRequestHandler();
9
+ this.defaultHttpClientCtor = client;
10
+ }
11
+ hasClient(name) {
12
+ return Object.keys(this._clients).includes(name);
13
+ }
14
+ configureClient(name, args) {
15
+ const argFn = typeof args === 'string' ? (x) => (x.uri = String(args)) : args;
16
+ const options = typeof argFn === 'function' ? { onCreate: argFn } : argFn;
17
+ this._clients[name] = Object.assign(Object.assign({}, this._clients[name]), options);
18
+ return this;
19
+ }
20
+ }
21
+ export default HttpClientConfigurator;
22
+ //# sourceMappingURL=configurator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurator.js","sourceRoot":"","sources":["../../src/configurator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAoFrD,MAAM,OAAO,sBAAsB;IAM/B,IAAW,OAAO;QACd,yBAAY,IAAI,CAAC,QAAQ,EAAG;IAChC,CAAC;IAcD,YAAY,MAAsC;QAnBxC,aAAQ,GAA+C,EAAE,CAAC;QAW3D,8BAAyB,GAAG,IAAI,kBAAkB,EAExD,CAAC;QAOA,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IACxC,CAAC;IAGD,SAAS,CAAC,IAAY;QAClB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAGD,eAAe,CACX,IAAY,EACZ,IAAsE;QAEtE,MAAM,KAAK,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjF,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,mCACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAClB,OAAiD,CACxD,CAAC;QACF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export class HttpResponseError extends Error {
2
+ constructor(message, response, options) {
3
+ super(message, options);
4
+ this.message = message;
5
+ this.response = response;
6
+ }
7
+ }
8
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxC,YACW,OAAe,EACf,QAAkB,EACzB,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAJjB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAU;IAI7B,CAAC;CACJ"}
@@ -0,0 +1,6 @@
1
+ export * from './configurator';
2
+ export * from './provider';
3
+ export * from './module';
4
+ export * from './errors';
5
+ export { default } from './module';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AAEzB,cAAc,UAAU,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { HttpClient } from './client';
2
+ export class HttpClientMsal extends HttpClient {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.defaultScopes = [];
6
+ }
7
+ fetch$(path, init) {
8
+ const args = Object.assign(init || {}, {
9
+ scopes: this.defaultScopes.concat((init === null || init === void 0 ? void 0 : init.scopes) || []),
10
+ });
11
+ return super._fetch$(path, args);
12
+ }
13
+ }
14
+ export default HttpClientMsal;
15
+ //# sourceMappingURL=client-msal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-msal.js","sourceRoot":"","sources":["../../../../src/lib/client/client-msal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAWtC,MAAM,OAAO,cAGX,SAAQ,UAA+B;IAHzC;;QAKW,kBAAa,GAAa,EAAE,CAAC;IAYxC,CAAC;IATG,MAAM,CACF,IAAY,EACZ,IAAmD;QAEnD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE;YACnC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,KAAI,EAAE,CAAC;SACxD,CAA6C,CAAC;QAC/C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACJ;AAED,eAAe,cAAc,CAAC"}