@podium/client 5.0.0-next.6 → 5.0.0-next.9

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,4 +1,347 @@
1
+ # [5.0.0-next.9](https://github.com/podium-lib/client/compare/v5.0.0-next.8...v5.0.0-next.9) (2022-05-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add 'redirect' to 'PodiumClientResponse' interface ([#235](https://github.com/podium-lib/client/issues/235)) ([6670007](https://github.com/podium-lib/client/commit/667000727187402d112c1087a4356492489a4003))
7
+ * **deps:** update dependency @podium/schemas to v4.1.17 ([6d249ed](https://github.com/podium-lib/client/commit/6d249ed8c3718642e78e71be6022feb113635ba8))
8
+ * **deps:** update dependency @podium/schemas to v4.1.18 ([36ca4a1](https://github.com/podium-lib/client/commit/36ca4a1425e227e30fd487a7e60908075628c32b))
9
+ * **deps:** update dependency @podium/schemas to v4.1.19 ([8a7f288](https://github.com/podium-lib/client/commit/8a7f288a57ce2d09d4cace08b836ef6c934a802c))
10
+ * **deps:** update dependency @podium/schemas to v4.1.20 ([b9c7ef4](https://github.com/podium-lib/client/commit/b9c7ef4665eb7aa852e9e3576bf89a0ee45c5fee))
11
+ * **deps:** update dependency @podium/schemas to v4.1.21 ([5a12fbd](https://github.com/podium-lib/client/commit/5a12fbdadd9a0f8ae1b4343ca33267852aa49aa0))
12
+ * **deps:** update dependency @podium/schemas to v4.1.22 ([a6ca70a](https://github.com/podium-lib/client/commit/a6ca70a87fdd264cfbefb0f5ecbe60c871606b00))
13
+ * **deps:** update dependency @podium/schemas to v4.1.23 ([0ad1042](https://github.com/podium-lib/client/commit/0ad104279a9a299737db5bbc5c2e65e43bacbc03))
14
+ * **deps:** update dependency @podium/schemas to v4.1.24 ([4cbad88](https://github.com/podium-lib/client/commit/4cbad88fc1a6b79627d0901e877fa9422292161d))
15
+ * **deps:** update dependency @podium/schemas to v4.1.25 ([8a8caa1](https://github.com/podium-lib/client/commit/8a8caa1c114c49b48a91383d45a75eb157e30140))
16
+ * **deps:** update dependency @podium/schemas to v4.1.26 ([a11d701](https://github.com/podium-lib/client/commit/a11d7019f9faeba1327af6df1b8377ae464c71b2))
17
+ * **deps:** update dependency @podium/schemas to v4.1.27 ([9b1d8d7](https://github.com/podium-lib/client/commit/9b1d8d711b435af1d517dc5d8e924d257cef529b))
18
+ * **deps:** update dependency @podium/schemas to v4.1.28 ([36e5398](https://github.com/podium-lib/client/commit/36e539822af10998a16c332b1303e1c8919f0ab3))
19
+ * **deps:** update dependency @podium/schemas to v4.1.29 ([7664934](https://github.com/podium-lib/client/commit/7664934071f7244a6c0213ea6c0a64153c435ed9))
20
+ * **deps:** update dependency @podium/schemas to v4.1.30 ([1a1c18e](https://github.com/podium-lib/client/commit/1a1c18e63a7a8130fcd450ffd9a03c11967d7416))
21
+ * **deps:** update dependency @podium/schemas to v4.1.31 ([563ebb7](https://github.com/podium-lib/client/commit/563ebb7c731f962250b56ba75d85689ebd92241e))
22
+ * **deps:** update dependency @podium/schemas to v4.1.32 ([fc13291](https://github.com/podium-lib/client/commit/fc13291ca3b6366d878bdd6bfdf10406dff11e74))
23
+ * **deps:** update dependency @podium/utils to v4.4.18 ([0448d3e](https://github.com/podium-lib/client/commit/0448d3ef39bfef8715b4e66ef8dc41a9634cd4cb))
24
+ * **deps:** update dependency @podium/utils to v4.4.19 ([e0c2c34](https://github.com/podium-lib/client/commit/e0c2c349fbf4d2db4efe060c0b883b07d6f0bcd8))
25
+ * **deps:** update dependency @podium/utils to v4.4.20 ([6b9b3f6](https://github.com/podium-lib/client/commit/6b9b3f630d521c189dca3b0acaecc46afe995036))
26
+ * **deps:** update dependency @podium/utils to v4.4.21 ([c007b67](https://github.com/podium-lib/client/commit/c007b67d118f3b88a8f91b915173dadb2b9026d0))
27
+ * **deps:** update dependency @podium/utils to v4.4.22 ([f65fbd0](https://github.com/podium-lib/client/commit/f65fbd00f2fe8256cc6290193dabd346907a1bda))
28
+ * **deps:** update dependency @podium/utils to v4.4.23 ([81200ea](https://github.com/podium-lib/client/commit/81200eabf600006f5c208e984acb4b81b28a725e))
29
+ * **deps:** update dependency @podium/utils to v4.4.24 ([747e73a](https://github.com/podium-lib/client/commit/747e73a7e737734b28520546bd6d449ab05497c8))
30
+ * **deps:** update dependency @podium/utils to v4.4.25 ([8e82542](https://github.com/podium-lib/client/commit/8e8254212ee69a01ba5b35c39aca2a2f558491b9))
31
+ * **deps:** update dependency @podium/utils to v4.4.26 ([9487380](https://github.com/podium-lib/client/commit/948738052a9d34294d52a0651c46b01043fa7852))
32
+ * **deps:** update dependency @podium/utils to v4.4.27 ([556a158](https://github.com/podium-lib/client/commit/556a158d1a341cca6f5e550de5882719b5169ac0))
33
+ * **deps:** update dependency @podium/utils to v4.4.28 ([581bdc6](https://github.com/podium-lib/client/commit/581bdc667d09d2b71e899691109a88b39b2b6847))
34
+ * **deps:** update dependency @podium/utils to v4.4.29 ([f33f1d9](https://github.com/podium-lib/client/commit/f33f1d93c33c7984b413b4781663a80c5dc52237))
35
+ * **deps:** update dependency @podium/utils to v4.4.30 ([954b607](https://github.com/podium-lib/client/commit/954b60788ca1d5677b143a473058e92c7ffcfef1))
36
+ * **deps:** update dependency @podium/utils to v4.4.31 ([0afdb26](https://github.com/podium-lib/client/commit/0afdb2648742e78b25e72bd46b6d345675574993))
37
+ * **deps:** update dependency @podium/utils to v4.4.32 ([798ed3a](https://github.com/podium-lib/client/commit/798ed3a5a89ccc046240f61f7bb85cc21045d0cf))
38
+ * **deps:** update dependency @podium/utils to v4.4.33 ([1136b6f](https://github.com/podium-lib/client/commit/1136b6f76d28229746f91b2fb1d44945c469dfd4))
39
+ * **deps:** update dependency @podium/utils to v4.4.34 ([81967fc](https://github.com/podium-lib/client/commit/81967fce15722ccfaab1ea64a6da475a319c5ab3))
40
+ * **deps:** update dependency @podium/utils to v4.4.35 ([9ba9720](https://github.com/podium-lib/client/commit/9ba9720698f1ce8548e8f76c07636a9f1ad44ac1))
41
+ * **deps:** update dependency @podium/utils to v4.4.36 ([6ca8bee](https://github.com/podium-lib/client/commit/6ca8bee3a3e49cfc10b55116ea8dd359ac3d2ebc))
42
+
43
+
44
+ ### Features
45
+
46
+ * Support mixed protocols ([#228](https://github.com/podium-lib/client/issues/228)) ([f1e42fe](https://github.com/podium-lib/client/commit/f1e42feb298e755b1274e5cf79cf77243457c538))
47
+
48
+ # [5.0.0-next.8](https://github.com/podium-lib/client/compare/v5.0.0-next.7...v5.0.0-next.8) (2021-05-17)
49
+ ## [4.5.22](https://github.com/podium-lib/client/compare/v4.5.21...v4.5.22) (2022-03-23)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * **deps:** update dependency @podium/utils to v4.4.36 ([6ca8bee](https://github.com/podium-lib/client/commit/6ca8bee3a3e49cfc10b55116ea8dd359ac3d2ebc))
55
+
56
+ ## [4.5.21](https://github.com/podium-lib/client/compare/v4.5.20...v4.5.21) (2022-03-23)
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * **deps:** update dependency @podium/schemas to v4.1.32 ([fc13291](https://github.com/podium-lib/client/commit/fc13291ca3b6366d878bdd6bfdf10406dff11e74))
62
+
63
+ ## [4.5.20](https://github.com/podium-lib/client/compare/v4.5.19...v4.5.20) (2022-02-05)
64
+
65
+
66
+ ### Bug Fixes
67
+
68
+ * **deps:** update dependency @podium/utils to v4.4.35 ([9ba9720](https://github.com/podium-lib/client/commit/9ba9720698f1ce8548e8f76c07636a9f1ad44ac1))
69
+
70
+ ## [4.5.19](https://github.com/podium-lib/client/compare/v4.5.18...v4.5.19) (2022-02-05)
71
+
72
+
73
+ ### Bug Fixes
74
+
75
+ * **deps:** update dependency @podium/schemas to v4.1.31 ([563ebb7](https://github.com/podium-lib/client/commit/563ebb7c731f962250b56ba75d85689ebd92241e))
76
+
77
+ ## [4.5.18](https://github.com/podium-lib/client/compare/v4.5.17...v4.5.18) (2022-01-15)
78
+
79
+
80
+ ### Bug Fixes
81
+
82
+ * **deps:** update dependency @podium/utils to v4.4.34 ([81967fc](https://github.com/podium-lib/client/commit/81967fce15722ccfaab1ea64a6da475a319c5ab3))
83
+
84
+ ## [4.5.17](https://github.com/podium-lib/client/compare/v4.5.16...v4.5.17) (2022-01-15)
85
+
86
+
87
+ ### Bug Fixes
88
+
89
+ * **deps:** update dependency @podium/schemas to v4.1.30 ([1a1c18e](https://github.com/podium-lib/client/commit/1a1c18e63a7a8130fcd450ffd9a03c11967d7416))
90
+
91
+ ## [4.5.16](https://github.com/podium-lib/client/compare/v4.5.15...v4.5.16) (2022-01-02)
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * **deps:** update dependency @podium/utils to v4.4.33 ([1136b6f](https://github.com/podium-lib/client/commit/1136b6f76d28229746f91b2fb1d44945c469dfd4))
97
+
98
+ ## [4.5.15](https://github.com/podium-lib/client/compare/v4.5.14...v4.5.15) (2021-11-22)
99
+
100
+
101
+ ### Bug Fixes
102
+
103
+ * **deps:** update dependency @podium/utils to v4.4.32 ([798ed3a](https://github.com/podium-lib/client/commit/798ed3a5a89ccc046240f61f7bb85cc21045d0cf))
104
+
105
+ ## [4.5.14](https://github.com/podium-lib/client/compare/v4.5.13...v4.5.14) (2021-11-22)
106
+
107
+
108
+ ### Bug Fixes
109
+
110
+ * **deps:** update dependency @podium/schemas to v4.1.29 ([7664934](https://github.com/podium-lib/client/commit/7664934071f7244a6c0213ea6c0a64153c435ed9))
111
+
112
+ ## [4.5.13](https://github.com/podium-lib/client/compare/v4.5.12...v4.5.13) (2021-11-17)
113
+
114
+
115
+ ### Bug Fixes
116
+
117
+ * **deps:** update dependency @podium/utils to v4.4.31 ([0afdb26](https://github.com/podium-lib/client/commit/0afdb2648742e78b25e72bd46b6d345675574993))
118
+
119
+ ## [4.5.12](https://github.com/podium-lib/client/compare/v4.5.11...v4.5.12) (2021-11-17)
120
+
121
+
122
+ ### Bug Fixes
123
+
124
+ * **deps:** update dependency @podium/schemas to v4.1.28 ([36e5398](https://github.com/podium-lib/client/commit/36e539822af10998a16c332b1303e1c8919f0ab3))
125
+
126
+ ## [4.5.11](https://github.com/podium-lib/client/compare/v4.5.10...v4.5.11) (2021-11-15)
127
+
128
+
129
+ ### Bug Fixes
130
+
131
+ * **deps:** update dependency @podium/utils to v4.4.30 ([954b607](https://github.com/podium-lib/client/commit/954b60788ca1d5677b143a473058e92c7ffcfef1))
132
+
133
+ ## [4.5.10](https://github.com/podium-lib/client/compare/v4.5.9...v4.5.10) (2021-11-14)
134
+
135
+
136
+ ### Bug Fixes
137
+
138
+ * **deps:** update dependency @podium/utils to v4.4.29 ([f33f1d9](https://github.com/podium-lib/client/commit/f33f1d93c33c7984b413b4781663a80c5dc52237))
139
+
140
+ ## [4.5.9](https://github.com/podium-lib/client/compare/v4.5.8...v4.5.9) (2021-11-14)
141
+
142
+
143
+ ### Bug Fixes
144
+
145
+ * **deps:** update dependency @podium/schemas to v4.1.27 ([9b1d8d7](https://github.com/podium-lib/client/commit/9b1d8d711b435af1d517dc5d8e924d257cef529b))
146
+
147
+ ## [4.5.8](https://github.com/podium-lib/client/compare/v4.5.7...v4.5.8) (2021-11-09)
148
+
149
+
150
+ ### Bug Fixes
151
+
152
+ * **deps:** update dependency @podium/utils to v4.4.28 ([581bdc6](https://github.com/podium-lib/client/commit/581bdc667d09d2b71e899691109a88b39b2b6847))
153
+
154
+ ## [4.5.7](https://github.com/podium-lib/client/compare/v4.5.6...v4.5.7) (2021-11-09)
155
+
156
+
157
+ ### Bug Fixes
158
+
159
+ * **deps:** update dependency @podium/schemas to v4.1.26 ([a11d701](https://github.com/podium-lib/client/commit/a11d7019f9faeba1327af6df1b8377ae464c71b2))
160
+
161
+ ## [4.5.6](https://github.com/podium-lib/client/compare/v4.5.5...v4.5.6) (2021-10-27)
162
+
163
+
164
+ ### Bug Fixes
165
+
166
+ * **deps:** update dependency @podium/utils to v4.4.27 ([556a158](https://github.com/podium-lib/client/commit/556a158d1a341cca6f5e550de5882719b5169ac0))
167
+
168
+ ## [4.5.5](https://github.com/podium-lib/client/compare/v4.5.4...v4.5.5) (2021-10-27)
169
+
170
+
171
+ ### Bug Fixes
172
+
173
+ * add 'redirect' to 'PodiumClientResponse' interface ([#235](https://github.com/podium-lib/client/issues/235)) ([6670007](https://github.com/podium-lib/client/commit/667000727187402d112c1087a4356492489a4003))
174
+
175
+ ## [4.5.4](https://github.com/podium-lib/client/compare/v4.5.3...v4.5.4) (2021-09-13)
176
+
177
+
178
+ ### Bug Fixes
179
+
180
+ * **deps:** update dependency @podium/utils to v4.4.26 ([9487380](https://github.com/podium-lib/client/commit/948738052a9d34294d52a0651c46b01043fa7852))
181
+
182
+ ## [4.5.3](https://github.com/podium-lib/client/compare/v4.5.2...v4.5.3) (2021-09-13)
183
+
184
+
185
+ ### Bug Fixes
186
+
187
+ * **deps:** update dependency @podium/schemas to v4.1.25 ([8a8caa1](https://github.com/podium-lib/client/commit/8a8caa1c114c49b48a91383d45a75eb157e30140))
188
+
189
+ ## [4.5.2](https://github.com/podium-lib/client/compare/v4.5.1...v4.5.2) (2021-08-14)
190
+
191
+
192
+ ### Bug Fixes
193
+
194
+ * **deps:** update dependency @podium/utils to v4.4.25 ([8e82542](https://github.com/podium-lib/client/commit/8e8254212ee69a01ba5b35c39aca2a2f558491b9))
195
+
196
+ ## [4.5.1](https://github.com/podium-lib/client/compare/v4.5.0...v4.5.1) (2021-08-14)
197
+
198
+
199
+ ### Bug Fixes
200
+
201
+ * **deps:** update dependency @podium/schemas to v4.1.24 ([4cbad88](https://github.com/podium-lib/client/commit/4cbad88fc1a6b79627d0901e877fa9422292161d))
202
+
203
+ # [4.5.0](https://github.com/podium-lib/client/compare/v4.4.33...v4.5.0) (2021-07-19)
204
+
205
+
206
+ ### Features
207
+
208
+ * Use native streams ([#215](https://github.com/podium-lib/client/issues/215)) ([f949c9c](https://github.com/podium-lib/client/commit/f949c9cc0d66431685138ca2c0367aec622bce78))
209
+
210
+ # [5.0.0-next.7](https://github.com/podium-lib/client/compare/v5.0.0-next.6...v5.0.0-next.7) (2021-05-05)
211
+ * Support mixed protocols ([#228](https://github.com/podium-lib/client/issues/228)) ([f1e42fe](https://github.com/podium-lib/client/commit/f1e42feb298e755b1274e5cf79cf77243457c538))
212
+
213
+ ## [4.4.33](https://github.com/podium-lib/client/compare/v4.4.32...v4.4.33) (2021-07-16)
214
+
215
+
216
+ ### Bug Fixes
217
+
218
+ * **deps:** update dependency @podium/schemas to v4.0.4 ([#136](https://github.com/podium-lib/client/issues/136)) ([9f71f0f](https://github.com/podium-lib/client/commit/9f71f0fe3c579d58c6a3b5376f8d9a0f3165867e)), closes [#142](https://github.com/podium-lib/client/issues/142)
219
+ * **deps:** update dependency @podium/schemas to v4.0.5 ([e9263c9](https://github.com/podium-lib/client/commit/e9263c9c7d7a890bd913249ea29adce9ed786ea3))
220
+ * **deps:** update dependency @podium/schemas to v4.1.10 ([8f12c52](https://github.com/podium-lib/client/commit/8f12c52ed6e3f0e214e66ee4c293e65422a0b9f2))
221
+ * **deps:** update dependency @podium/schemas to v4.1.11 ([4f136aa](https://github.com/podium-lib/client/commit/4f136aa20e99537dc8e4633133325b95a035640f))
222
+ * **deps:** update dependency @podium/schemas to v4.1.14 ([3870a77](https://github.com/podium-lib/client/commit/3870a77ccd7d03f05f051e42c49dfa4b1cd25e14))
223
+ * **deps:** update dependency @podium/schemas to v4.1.15 ([f9eea3f](https://github.com/podium-lib/client/commit/f9eea3faa87047316ace92382780899fc6d1533e))
224
+ * **deps:** update dependency @podium/schemas to v4.1.16 ([2156ae4](https://github.com/podium-lib/client/commit/2156ae49c6832a9d9895bdb4d506b83c5c67205e))
225
+ * **deps:** update dependency @podium/utils to v4.3.1 ([f5483b6](https://github.com/podium-lib/client/commit/f5483b6445baf36e6d1d33daa59da564a42ef33e))
226
+ * **deps:** update dependency @podium/utils to v4.3.3 ([f4ee3a2](https://github.com/podium-lib/client/commit/f4ee3a2d6e821cfd9033deac4ed5661c0eb5fbf8))
227
+ * **deps:** update dependency @podium/utils to v4.4.0 ([f3712b3](https://github.com/podium-lib/client/commit/f3712b3be5e17d0e2956e9e4cae3cf79696a3634))
228
+ * **deps:** update dependency @podium/utils to v4.4.1 ([3f0dddc](https://github.com/podium-lib/client/commit/3f0dddcf3b203d1903dc13fa4522c632459ae48b))
229
+ * **deps:** update dependency @podium/utils to v4.4.13 ([6771733](https://github.com/podium-lib/client/commit/67717335c91b5366c2931cbf8d34e5d62c720678))
230
+ * **deps:** update dependency @podium/utils to v4.4.14 ([cd7ed39](https://github.com/podium-lib/client/commit/cd7ed39fadf12232a6fc67678815dd30c8a076ac))
231
+ * **deps:** update dependency @podium/utils to v4.4.15 ([ce00590](https://github.com/podium-lib/client/commit/ce00590e5c5eb23ca138f4337605b8a84787e01c))
232
+ * **deps:** update dependency @podium/utils to v4.4.16 ([f0bfe5f](https://github.com/podium-lib/client/commit/f0bfe5f24d4fc0a69e36cab7e80b0d8d11415aca))
233
+ * **deps:** update dependency @podium/utils to v4.4.17 ([a57669c](https://github.com/podium-lib/client/commit/a57669c5e26745a04b5e7b453db41049d7aea8c7))
234
+ * Update @podium/schema to version 4.1.9 to fix ajv error ([#188](https://github.com/podium-lib/client/issues/188)) ([1b03065](https://github.com/podium-lib/client/commit/1b0306562a15e0fe496adb22bf9b2aa76ac26436))
235
+
236
+
237
+ ### Features
238
+
239
+ * Convert to ESM ([#206](https://github.com/podium-lib/client/issues/206)) ([d31298f](https://github.com/podium-lib/client/commit/d31298fac7e1b84dc401c5832bce132a68a84943))
240
+
241
+
242
+ ### BREAKING CHANGES
243
+
244
+ * Convert from CommonJS to ESM
245
+
246
+ * fix: Remove outcommented code
247
+
248
+ Co-authored-by: Trygve Lie <trygve.lie@finn.no>
249
+
1
250
  # [5.0.0-next.6](https://github.com/podium-lib/client/compare/v5.0.0-next.5...v5.0.0-next.6) (2020-10-06)
251
+ * **deps:** update dependency @podium/utils to v4.4.24 ([747e73a](https://github.com/podium-lib/client/commit/747e73a7e737734b28520546bd6d449ab05497c8))
252
+
253
+ ## [4.4.32](https://github.com/podium-lib/client/compare/v4.4.31...v4.4.32) (2021-07-16)
254
+
255
+
256
+ ### Bug Fixes
257
+
258
+ * **deps:** update dependency @podium/schemas to v4.1.23 ([0ad1042](https://github.com/podium-lib/client/commit/0ad104279a9a299737db5bbc5c2e65e43bacbc03))
259
+
260
+ ## [4.4.31](https://github.com/podium-lib/client/compare/v4.4.30...v4.4.31) (2021-07-04)
261
+
262
+
263
+ ### Bug Fixes
264
+
265
+ * **deps:** update dependency @podium/schemas to v4.1.22 ([a6ca70a](https://github.com/podium-lib/client/commit/a6ca70a87fdd264cfbefb0f5ecbe60c871606b00))
266
+
267
+ ## [4.4.30](https://github.com/podium-lib/client/compare/v4.4.29...v4.4.30) (2021-07-04)
268
+
269
+
270
+ ### Bug Fixes
271
+
272
+ * **deps:** update dependency @podium/utils to v4.4.23 ([81200ea](https://github.com/podium-lib/client/commit/81200eabf600006f5c208e984acb4b81b28a725e))
273
+
274
+ ## [4.4.29](https://github.com/podium-lib/client/compare/v4.4.28...v4.4.29) (2021-06-07)
275
+
276
+
277
+ ### Bug Fixes
278
+
279
+ * **deps:** update dependency @podium/utils to v4.4.22 ([f65fbd0](https://github.com/podium-lib/client/commit/f65fbd00f2fe8256cc6290193dabd346907a1bda))
280
+
281
+ ## [4.4.28](https://github.com/podium-lib/client/compare/v4.4.27...v4.4.28) (2021-06-06)
282
+
283
+
284
+ ### Bug Fixes
285
+
286
+ * **deps:** update dependency @podium/schemas to v4.1.21 ([5a12fbd](https://github.com/podium-lib/client/commit/5a12fbdadd9a0f8ae1b4343ca33267852aa49aa0))
287
+
288
+ ## [4.4.27](https://github.com/podium-lib/client/compare/v4.4.26...v4.4.27) (2021-05-24)
289
+
290
+
291
+ ### Bug Fixes
292
+
293
+ * **deps:** update dependency @podium/utils to v4.4.21 ([c007b67](https://github.com/podium-lib/client/commit/c007b67d118f3b88a8f91b915173dadb2b9026d0))
294
+
295
+ ## [4.4.26](https://github.com/podium-lib/client/compare/v4.4.25...v4.4.26) (2021-05-24)
296
+
297
+
298
+ ### Bug Fixes
299
+
300
+ * **deps:** update dependency @podium/schemas to v4.1.20 ([b9c7ef4](https://github.com/podium-lib/client/commit/b9c7ef4665eb7aa852e9e3576bf89a0ee45c5fee))
301
+
302
+ ## [4.4.25](https://github.com/podium-lib/client/compare/v4.4.24...v4.4.25) (2021-05-15)
303
+
304
+
305
+ ### Bug Fixes
306
+
307
+ * **deps:** update dependency @podium/utils to v4.4.20 ([6b9b3f6](https://github.com/podium-lib/client/commit/6b9b3f630d521c189dca3b0acaecc46afe995036))
308
+
309
+ ## [4.4.24](https://github.com/podium-lib/client/compare/v4.4.23...v4.4.24) (2021-05-14)
310
+
311
+
312
+ ### Bug Fixes
313
+
314
+ * **deps:** update dependency @podium/schemas to v4.1.19 ([8a7f288](https://github.com/podium-lib/client/commit/8a7f288a57ce2d09d4cace08b836ef6c934a802c))
315
+
316
+ ## [4.4.23](https://github.com/podium-lib/client/compare/v4.4.22...v4.4.23) (2021-05-09)
317
+
318
+
319
+ ### Bug Fixes
320
+
321
+ * **deps:** update dependency @podium/utils to v4.4.19 ([e0c2c34](https://github.com/podium-lib/client/commit/e0c2c349fbf4d2db4efe060c0b883b07d6f0bcd8))
322
+
323
+ ## [4.4.22](https://github.com/podium-lib/client/compare/v4.4.21...v4.4.22) (2021-05-09)
324
+
325
+
326
+ ### Bug Fixes
327
+
328
+ * **deps:** update dependency @podium/schemas to v4.1.18 ([36ca4a1](https://github.com/podium-lib/client/commit/36ca4a1425e227e30fd487a7e60908075628c32b))
329
+
330
+ ## [4.4.21](https://github.com/podium-lib/client/compare/v4.4.20...v4.4.21) (2021-05-05)
331
+
332
+
333
+ ### Bug Fixes
334
+
335
+ * **deps:** update dependency @podium/utils to v4.4.18 ([0448d3e](https://github.com/podium-lib/client/commit/0448d3ef39bfef8715b4e66ef8dc41a9634cd4cb))
336
+
337
+ ## [4.4.20](https://github.com/podium-lib/client/compare/v4.4.19...v4.4.20) (2021-05-05)
338
+
339
+
340
+ ### Bug Fixes
341
+
342
+ * **deps:** update dependency @podium/schemas to v4.1.17 ([6d249ed](https://github.com/podium-lib/client/commit/6d249ed8c3718642e78e71be6022feb113635ba8))
343
+
344
+ ## [4.4.19](https://github.com/podium-lib/client/compare/v4.4.18...v4.4.19) (2021-04-27)
2
345
 
3
346
 
4
347
  ### Bug Fixes
@@ -104,6 +447,114 @@ Co-authored-by: Trygve Lie <trygve.lie@finn.no>
104
447
  ### BREAKING CHANGES
105
448
 
106
449
  * `HttpIncoming` must now be passed as the first argument to .fetch() and .stream()
450
+ * **deps:** update dependency @podium/utils to v4.4.17 ([a57669c](https://github.com/podium-lib/client/commit/a57669c5e26745a04b5e7b453db41049d7aea8c7))
451
+
452
+ ## [4.4.18](https://github.com/podium-lib/client/compare/v4.4.17...v4.4.18) (2021-04-27)
453
+
454
+
455
+ ### Bug Fixes
456
+
457
+ * **deps:** update dependency @podium/schemas to v4.1.16 ([2156ae4](https://github.com/podium-lib/client/commit/2156ae49c6832a9d9895bdb4d506b83c5c67205e))
458
+
459
+ ## [4.4.17](https://github.com/podium-lib/client/compare/v4.4.16...v4.4.17) (2021-04-12)
460
+
461
+
462
+ ### Bug Fixes
463
+
464
+ * **deps:** update dependency @podium/utils to v4.4.16 ([f0bfe5f](https://github.com/podium-lib/client/commit/f0bfe5f24d4fc0a69e36cab7e80b0d8d11415aca))
465
+
466
+ ## [4.4.16](https://github.com/podium-lib/client/compare/v4.4.15...v4.4.16) (2021-04-11)
467
+
468
+
469
+ ### Bug Fixes
470
+
471
+ * **deps:** update dependency @podium/schemas to v4.1.15 ([f9eea3f](https://github.com/podium-lib/client/commit/f9eea3faa87047316ace92382780899fc6d1533e))
472
+
473
+ ## [4.4.15](https://github.com/podium-lib/client/compare/v4.4.14...v4.4.15) (2021-04-02)
474
+
475
+
476
+ ### Bug Fixes
477
+
478
+ * **deps:** update dependency @podium/utils to v4.4.15 ([ce00590](https://github.com/podium-lib/client/commit/ce00590e5c5eb23ca138f4337605b8a84787e01c))
479
+
480
+ ## [4.4.14](https://github.com/podium-lib/client/compare/v4.4.13...v4.4.14) (2021-04-02)
481
+
482
+
483
+ ### Bug Fixes
484
+
485
+ * **deps:** update dependency @podium/utils to v4.4.14 ([cd7ed39](https://github.com/podium-lib/client/commit/cd7ed39fadf12232a6fc67678815dd30c8a076ac))
486
+
487
+ ## [4.4.13](https://github.com/podium-lib/client/compare/v4.4.12...v4.4.13) (2021-04-02)
488
+
489
+
490
+ ### Bug Fixes
491
+
492
+ * **deps:** update dependency @podium/schemas to v4.1.14 ([3870a77](https://github.com/podium-lib/client/commit/3870a77ccd7d03f05f051e42c49dfa4b1cd25e14))
493
+
494
+ ## [4.4.12](https://github.com/podium-lib/client/compare/v4.4.11...v4.4.12) (2021-04-01)
495
+
496
+
497
+ ### Bug Fixes
498
+
499
+ * **deps:** update dependency @podium/utils to v4.4.13 ([6771733](https://github.com/podium-lib/client/commit/67717335c91b5366c2931cbf8d34e5d62c720678))
500
+
501
+ ## [4.4.11](https://github.com/podium-lib/client/compare/v4.4.10...v4.4.11) (2021-04-01)
502
+
503
+
504
+ ### Bug Fixes
505
+
506
+ * **deps:** update dependency @podium/schemas to v4.1.11 ([4f136aa](https://github.com/podium-lib/client/commit/4f136aa20e99537dc8e4633133325b95a035640f))
507
+
508
+ ## [4.4.10](https://github.com/podium-lib/client/compare/v4.4.9...v4.4.10) (2021-03-31)
509
+
510
+
511
+ ### Bug Fixes
512
+
513
+ * **deps:** update dependency @podium/schemas to v4.1.10 ([8f12c52](https://github.com/podium-lib/client/commit/8f12c52ed6e3f0e214e66ee4c293e65422a0b9f2))
514
+
515
+ ## [4.4.9](https://github.com/podium-lib/client/compare/v4.4.8...v4.4.9) (2021-03-31)
516
+
517
+
518
+ ### Bug Fixes
519
+
520
+ * Update @podium/schema to version 4.1.9 to fix ajv error ([#188](https://github.com/podium-lib/client/issues/188)) ([1b03065](https://github.com/podium-lib/client/commit/1b0306562a15e0fe496adb22bf9b2aa76ac26436))
521
+
522
+ ## [4.4.8](https://github.com/podium-lib/client/compare/v4.4.7...v4.4.8) (2020-10-29)
523
+
524
+
525
+ ### Bug Fixes
526
+
527
+ * **deps:** update dependency @podium/utils to v4.4.1 ([3f0dddc](https://github.com/podium-lib/client/commit/3f0dddcf3b203d1903dc13fa4522c632459ae48b))
528
+
529
+ ## [4.4.7](https://github.com/podium-lib/client/compare/v4.4.6...v4.4.7) (2020-10-12)
530
+
531
+
532
+ ### Bug Fixes
533
+
534
+ * **deps:** update dependency @podium/utils to v4.4.0 ([f3712b3](https://github.com/podium-lib/client/commit/f3712b3be5e17d0e2956e9e4cae3cf79696a3634))
535
+
536
+ ## [4.4.6](https://github.com/podium-lib/client/compare/v4.4.5...v4.4.6) (2020-10-10)
537
+
538
+
539
+ ### Bug Fixes
540
+
541
+ * **deps:** update dependency @podium/utils to v4.3.3 ([f4ee3a2](https://github.com/podium-lib/client/commit/f4ee3a2d6e821cfd9033deac4ed5661c0eb5fbf8))
542
+
543
+ ## [4.4.5](https://github.com/podium-lib/client/compare/v4.4.4...v4.4.5) (2020-10-10)
544
+
545
+
546
+ ### Bug Fixes
547
+
548
+ * **deps:** update dependency @podium/schemas to v4.0.5 ([e9263c9](https://github.com/podium-lib/client/commit/e9263c9c7d7a890bd913249ea29adce9ed786ea3))
549
+
550
+ ## [4.4.4](https://github.com/podium-lib/client/compare/v4.4.3...v4.4.4) (2020-10-06)
551
+
552
+
553
+ ### Bug Fixes
554
+
555
+ * **deps:** update dependency @podium/schemas to v4.0.4 ([#136](https://github.com/podium-lib/client/issues/136)) ([9f71f0f](https://github.com/podium-lib/client/commit/9f71f0fe3c579d58c6a3b5376f8d9a0f3165867e)), closes [#142](https://github.com/podium-lib/client/issues/142)
556
+ * **deps:** update dependency @podium/utils to v4.3.1 ([f5483b6](https://github.com/podium-lib/client/commit/f5483b6445baf36e6d1d33daa59da564a42ef33e))
557
+
107
558
  ## [4.4.3](https://github.com/podium-lib/client/compare/v4.4.2...v4.4.3) (2020-10-06)
108
559
 
109
560
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/index.d.ts CHANGED
@@ -8,6 +8,7 @@ declare interface PodiumClientResourceOptions {
8
8
  }
9
9
 
10
10
  declare interface PodiumClientResponse {
11
+ readonly redirect: PodiumRedirect;
11
12
  readonly content: string;
12
13
  readonly headers: IncomingHttpHeaders;
13
14
  readonly js: Array<AssetJs>;
@@ -43,6 +44,11 @@ declare interface RegisterOptions {
43
44
  resolveCss?: boolean;
44
45
  }
45
46
 
47
+ declare interface PodiumRedirect {
48
+ readonly statusCode: number;
49
+ readonly location: string;
50
+ }
51
+
46
52
  export default class PodiumClient {
47
53
  readonly state:
48
54
  | 'instantiated'
package/lib/client.js CHANGED
@@ -1,15 +1,13 @@
1
- 'use strict';
1
+ import EventEmitter from 'events';
2
+ import {uriStrict as validateUriStrict, name as validateName } from'@podium/schemas';
3
+ import Metrics from '@metrics/client';
4
+ import abslog from 'abslog';
5
+ import Cache from 'ttl-mem-cache';
6
+ import http from 'http';
7
+ import https from 'https';
2
8
 
3
- const EventEmitter = require('events');
4
- const { validate } = require('@podium/schemas');
5
- const Metrics = require('@metrics/client');
6
- const abslog = require('abslog');
7
- const Cache = require('ttl-mem-cache');
8
- const http = require('http');
9
- const https = require('https');
10
-
11
- const Resource = require('./resource');
12
- const State = require('./state');
9
+ import Resource from './resource.js';
10
+ import State from './state.js';
13
11
 
14
12
  const inspect = Symbol.for('nodejs.util.inspect.custom');
15
13
 
@@ -26,6 +24,8 @@ const HTTPS_AGENT_OPTIONS = {
26
24
  maxCachedSessions: 10,
27
25
  };
28
26
 
27
+ const REJECT_UNAUTHORIZED = true;
28
+
29
29
  const HTTP_AGENT = new http.Agent(HTTP_AGENT_OPTIONS);
30
30
 
31
31
  const HTTPS_AGENT = new https.Agent(HTTPS_AGENT_OPTIONS);
@@ -36,7 +36,7 @@ const TIMEOUT = 1000; // 1 seconds
36
36
 
37
37
  const MAX_AGE = Infinity;
38
38
 
39
- const PodiumClient = class PodiumClient extends EventEmitter {
39
+ export default class PodiumClient extends EventEmitter {
40
40
  #resources;
41
41
  #registry;
42
42
  #metrics;
@@ -47,7 +47,7 @@ const PodiumClient = class PodiumClient extends EventEmitter {
47
47
  super();
48
48
  const log = abslog(options.logger);
49
49
 
50
- if (validate.name(options.name).error) {
50
+ if (validateName(options.name).error) {
51
51
  throw new Error(
52
52
  `The value, "${options.name}", for the required argument "name" on the Client constructor is not defined or not valid.`,
53
53
  );
@@ -59,6 +59,7 @@ const PodiumClient = class PodiumClient extends EventEmitter {
59
59
  timeout: TIMEOUT,
60
60
  logger: options.logger,
61
61
  maxAge: MAX_AGE,
62
+ rejectUnauthorized: REJECT_UNAUTHORIZED,
62
63
  httpAgent: HTTP_AGENT,
63
64
  httpsAgent: HTTPS_AGENT,
64
65
  ...options,
@@ -128,12 +129,12 @@ const PodiumClient = class PodiumClient extends EventEmitter {
128
129
  }
129
130
 
130
131
  register(options = {}) {
131
- if (validate.name(options.name).error)
132
+ if (validateName(options.name).error)
132
133
  throw new Error(
133
134
  `The value, "${options.name}", for the required argument "name" on the .register() method is not defined or not valid.`,
134
135
  );
135
136
 
136
- if (validate.uriStrict(options.uri).error)
137
+ if (validateUriStrict(options.uri).error)
137
138
  throw new Error(
138
139
  `The value, "${options.uri}", for the required argument "uri" on the .register() method is not defined or not valid.`,
139
140
  );
@@ -145,14 +146,14 @@ const PodiumClient = class PodiumClient extends EventEmitter {
145
146
  }
146
147
 
147
148
  const resourceOptions = {
149
+ rejectUnauthorized: this.#options.rejectUnauthorized,
148
150
  clientName: this.#options.name,
149
151
  retries: this.#options.retries,
150
152
  timeout: this.#options.timeout,
151
153
  logger: this.#options.logger,
152
154
  maxAge: this.#options.maxAge,
153
- agent: options.uri.startsWith('https://')
154
- ? this.#options.httpsAgent
155
- : this.#options.httpAgent,
155
+ httpsAgent: this.#options.httpsAgent,
156
+ httpAgent: this.#options.httpAgent,
156
157
  ...options,
157
158
  };
158
159
  const resource = new Resource(
@@ -204,4 +205,3 @@ const PodiumClient = class PodiumClient extends EventEmitter {
204
205
  return 'PodiumClient';
205
206
  }
206
207
  };
207
- module.exports = PodiumClient;
@@ -1,11 +1,10 @@
1
1
  /* eslint-disable no-underscore-dangle */
2
2
 
3
- 'use strict';
3
+ import { PassThrough } from 'stream';
4
+ import assert from 'assert';
4
5
 
5
- const { PassThrough } = require('readable-stream');
6
- const assert = require('assert');
7
-
8
- const PodletClientHttpOutgoing = class PodletClientHttpOutgoing extends PassThrough {
6
+ export default class PodletClientHttpOutgoing extends PassThrough {
7
+ #rejectUnauthorized;
9
8
  #killRecursions;
10
9
  #killThreshold;
11
10
  #redirectable;
@@ -23,6 +22,7 @@ const PodletClientHttpOutgoing = class PodletClientHttpOutgoing extends PassThro
23
22
  #uri;
24
23
  constructor(
25
24
  {
25
+ rejectUnauthorized = true,
26
26
  throwable = false,
27
27
  redirectable = false,
28
28
  retries = 4,
@@ -41,6 +41,9 @@ const PodletClientHttpOutgoing = class PodletClientHttpOutgoing extends PassThro
41
41
  'you must pass a URI in "options.uri" to the HttpOutgoing constructor',
42
42
  );
43
43
 
44
+ // If requests to https sites should reject on unsigned sertificates
45
+ this.#rejectUnauthorized = rejectUnauthorized;
46
+
44
47
  // A HttpIncoming object
45
48
  this.#incoming = incoming;
46
49
 
@@ -102,6 +105,10 @@ const PodletClientHttpOutgoing = class PodletClientHttpOutgoing extends PassThro
102
105
  this.#redirect = null;
103
106
  }
104
107
 
108
+ get rejectUnauthorized() {
109
+ return this.#rejectUnauthorized;
110
+ }
111
+
105
112
  get reqOptions() {
106
113
  return this.#reqOptions;
107
114
  }
@@ -219,4 +226,3 @@ const PodletClientHttpOutgoing = class PodletClientHttpOutgoing extends PassThro
219
226
  return 'PodletClientHttpOutgoing';
220
227
  }
221
228
  };
222
- module.exports = PodletClientHttpOutgoing;
@@ -1,13 +1,11 @@
1
1
  /* eslint-disable no-plusplus */
2
2
  /* eslint-disable no-param-reassign */
3
3
 
4
- 'use strict';
4
+ import clonedeep from 'lodash.clonedeep';
5
+ import abslog from 'abslog';
6
+ import assert from 'assert';
5
7
 
6
- const clonedeep = require('lodash.clonedeep');
7
- const abslog = require('abslog');
8
- const assert = require('assert');
9
-
10
- module.exports = class PodletClientCacheResolver {
8
+ export default class PodletClientCacheResolver {
11
9
  #registry;
12
10
  #log;
13
11
  constructor(registry, options = {}) {
@@ -1,28 +1,36 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
 
3
- 'use strict';
4
-
5
- const { pipeline } = require('readable-stream');
6
- const Metrics = require('@metrics/client');
7
- const request = require('request');
8
- const abslog = require('abslog');
9
- const putils = require('@podium/utils');
10
- const { Boom, badGateway } = require('@hapi/boom');
11
- const Response = require('./response');
12
- const utils = require('./utils');
13
- const pkg = require('../package.json');
3
+ import { pipeline } from 'stream';
4
+ import Metrics from '@metrics/client';
5
+ import request from 'request';
6
+ import abslog from 'abslog';
7
+ import * as putils from '@podium/utils';
8
+ import { Boom, badGateway } from '@hapi/boom';
9
+
10
+ import { join, dirname } from 'path';
11
+ import { fileURLToPath } from 'url';
12
+ import fs from 'fs';
13
+ import * as utils from './utils.js';
14
+ import Response from './response.js';
15
+
16
+ const currentDirectory = dirname(fileURLToPath(import.meta.url));
17
+
18
+ const pkgJson = fs.readFileSync(join(currentDirectory, '../package.json'), 'utf-8');
19
+ const pkg = JSON.parse(pkgJson);
14
20
 
15
21
  const UA_STRING = `${pkg.name} ${pkg.version}`;
16
22
 
17
- module.exports = class PodletClientContentResolver {
23
+ export default class PodletClientContentResolver {
18
24
  #log;
19
- #agent;
20
25
  #metrics;
21
26
  #histogram;
27
+ #httpAgent;
28
+ #httpsAgent;
22
29
  constructor(options = {}) {
23
30
  const name = options.clientName;
24
31
  this.#log = abslog(options.logger);
25
- this.#agent = options.agent;
32
+ this.#httpAgent = options.httpAgent;
33
+ this.#httpsAgent = options.httpsAgent;
26
34
  this.#metrics = new Metrics();
27
35
  this.#histogram = this.#metrics.histogram({
28
36
  name: 'podium_client_resolver_content_resolve',
@@ -99,9 +107,12 @@ module.exports = class PodletClientContentResolver {
99
107
  putils.serializeContext(headers, outgoing.context, outgoing.name);
100
108
 
101
109
  const reqOptions = {
110
+ rejectUnauthorized: outgoing.rejectUnauthorized,
102
111
  timeout: outgoing.timeout,
103
112
  method: 'GET',
104
- agent: this.#agent,
113
+ agent: outgoing.contentUri.startsWith('https://')
114
+ ? this.#httpsAgent
115
+ : this.#httpAgent,
105
116
  uri: putils.uriBuilder(
106
117
  outgoing.reqOptions.pathname,
107
118
  outgoing.contentUri,
@@ -217,7 +228,7 @@ module.exports = class PodletClientContentResolver {
217
228
  }),
218
229
  );
219
230
 
220
- pipeline(r, outgoing, err => {
231
+ pipeline([r, outgoing], (err) => {
221
232
  if (err) {
222
233
  this.#log.warn('error while piping content stream', err);
223
234
  }
@@ -1,24 +1,32 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
 
3
- 'use strict';
3
+ import request from 'request';
4
+ import abslog from 'abslog';
5
+ import Metrics from '@metrics/client';
4
6
 
5
- const request = require('request');
6
- const abslog = require('abslog');
7
- const Metrics = require('@metrics/client');
8
- const pkg = require('../package.json');
7
+ import { join, dirname } from 'path';
8
+ import { fileURLToPath } from 'url';
9
+ import fs from 'fs';
10
+
11
+ const currentDirectory = dirname(fileURLToPath(import.meta.url));
12
+
13
+ const pkgJson = fs.readFileSync(join(currentDirectory, '../package.json'), 'utf-8');
14
+ const pkg = JSON.parse(pkgJson);
9
15
 
10
16
  const UA_STRING = `${pkg.name} ${pkg.version}`;
11
17
 
12
- module.exports = class PodletClientFallbackResolver {
18
+ export default class PodletClientFallbackResolver {
13
19
  #log;
14
- #agent;
15
20
  #metrics;
16
21
  #histogram;
22
+ #httpAgent;
23
+ #httpsAgent;
17
24
  constructor(options = {}) {
18
25
  const name = options.clientName;
19
26
  this.#log = abslog(options.logger);
20
- this.#agent = options.agent;
21
27
  this.#metrics = new Metrics();
28
+ this.#httpAgent = options.httpAgent;
29
+ this.#httpsAgent = options.httpsAgent;
22
30
  this.#histogram = this.#metrics.histogram({
23
31
  name: 'podium_client_resolver_fallback_resolve',
24
32
  description: 'Time taken for success/failure of fallback request',
@@ -29,7 +37,7 @@ module.exports = class PodletClientFallbackResolver {
29
37
  },
30
38
  buckets: [0.001, 0.01, 0.1, 0.5, 1, 2, 10],
31
39
  });
32
-
40
+
33
41
  this.#metrics.on('error', error => {
34
42
  this.#log.error(
35
43
  'Error emitted by metric stream in @podium/client module',
@@ -74,9 +82,12 @@ module.exports = class PodletClientFallbackResolver {
74
82
  };
75
83
 
76
84
  const reqOptions = {
85
+ rejectUnauthorized: outgoing.rejectUnauthorized,
77
86
  timeout: outgoing.timeout,
78
87
  method: 'GET',
79
- agent: this.#agent,
88
+ agent: outgoing.fallbackUri.startsWith('https://')
89
+ ? this.#httpsAgent
90
+ : this.#httpAgent,
80
91
  uri: outgoing.fallbackUri,
81
92
  headers,
82
93
  };
package/lib/resolver.js CHANGED
@@ -1,14 +1,12 @@
1
- 'use strict';
1
+ import Metrics from '@metrics/client';
2
+ import abslog from 'abslog';
3
+ import assert from 'assert';
4
+ import Manifest from './resolver.manifest.js';
5
+ import Fallback from './resolver.fallback.js';
6
+ import Content from './resolver.content.js';
7
+ import Cache from './resolver.cache.js';
2
8
 
3
- const Metrics = require('@metrics/client');
4
- const abslog = require('abslog');
5
- const assert = require('assert');
6
- const Manifest = require('./resolver.manifest');
7
- const Fallback = require('./resolver.fallback');
8
- const Content = require('./resolver.content');
9
- const Cache = require('./resolver.cache');
10
-
11
- module.exports = class PodletClientResolver {
9
+ export default class PodletClientResolver {
12
10
  #cache;
13
11
  #manifest;
14
12
  #fallback;
@@ -1,27 +1,35 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
 
3
- 'use strict';
3
+ import CachePolicy from 'http-cache-semantics';
4
+ import {manifest as validateManifest } from'@podium/schemas';
5
+ import request from 'request';
6
+ import Metrics from '@metrics/client';
7
+ import abslog from 'abslog';
8
+ import * as utils from '@podium/utils';
4
9
 
5
- const { validate } = require('@podium/schemas');
6
- const CachePolicy = require('http-cache-semantics');
7
- const request = require('request');
8
- const Metrics = require('@metrics/client');
9
- const abslog = require('abslog');
10
- const utils = require('@podium/utils');
11
- const pkg = require('../package.json');
10
+ import { join, dirname } from 'path';
11
+ import { fileURLToPath } from 'url';
12
+ import fs from 'fs';
13
+
14
+ const currentDirectory = dirname(fileURLToPath(import.meta.url));
15
+
16
+ const pkgJson = fs.readFileSync(join(currentDirectory, '../package.json'), 'utf-8');
17
+ const pkg = JSON.parse(pkgJson);
12
18
 
13
19
  const UA_STRING = `${pkg.name} ${pkg.version}`;
14
20
 
15
- module.exports = class PodletClientManifestResolver {
21
+ export default class PodletClientManifestResolver {
16
22
  #log;
17
- #agent;
18
23
  #metrics;
24
+ #httpAgent;
25
+ #httpsAgent;
19
26
  #histogram;
20
27
  constructor(options = {}) {
21
28
  const name = options.clientName;
22
29
  this.#log = abslog(options.logger);
23
- this.#agent = options.agent;
24
30
  this.#metrics = new Metrics();
31
+ this.#httpAgent = options.httpAgent;
32
+ this.#httpsAgent = options.httpsAgent;
25
33
  this.#histogram = this.#metrics.histogram({
26
34
  name: 'podium_client_resolver_manifest_resolve',
27
35
  description: 'Time taken for success/failure of manifest request',
@@ -57,9 +65,12 @@ module.exports = class PodletClientManifestResolver {
57
65
  };
58
66
 
59
67
  const reqOptions = {
68
+ rejectUnauthorized: outgoing.rejectUnauthorized,
60
69
  timeout: outgoing.timeout,
61
70
  method: 'GET',
62
- agent: this.#agent,
71
+ agent: outgoing.manifestUri.startsWith('https://')
72
+ ? this.#httpsAgent
73
+ : this.#httpAgent,
63
74
  json: true,
64
75
  uri: outgoing.manifestUri,
65
76
  headers,
@@ -107,7 +118,7 @@ module.exports = class PodletClientManifestResolver {
107
118
  return;
108
119
  }
109
120
 
110
- const manifest = validate.manifest(body);
121
+ const manifest = validateManifest(body);
111
122
 
112
123
  // Manifest validation error
113
124
  if (manifest.error) {
package/lib/resource.js CHANGED
@@ -1,20 +1,18 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
 
3
- 'use strict';
3
+ import Metrics from '@metrics/client';
4
+ import stream from 'stream';
5
+ import abslog from 'abslog';
6
+ import assert from 'assert';
4
7
 
5
- const Metrics = require('@metrics/client');
6
- const stream = require('readable-stream');
7
- const abslog = require('abslog');
8
- const assert = require('assert');
9
-
10
- const HttpOutgoing = require('./http-outgoing');
11
- const Response = require('./response');
12
- const Resolver = require('./resolver');
13
- const utils = require('./utils');
8
+ import HttpOutgoing from './http-outgoing.js';
9
+ import Response from './response.js';
10
+ import Resolver from './resolver.js';
11
+ import * as utils from './utils.js';
14
12
 
15
13
  const inspect = Symbol.for('nodejs.util.inspect.custom');
16
14
 
17
- const PodiumClientResource = class PodiumClientResource {
15
+ export default class PodiumClientResource {
18
16
  #resolver;
19
17
  #options;
20
18
  #metrics;
@@ -73,7 +71,9 @@ const PodiumClientResource = class PodiumClientResource {
73
71
  },
74
72
  });
75
73
 
76
- stream.pipeline(outgoing, to);
74
+ stream.pipeline([outgoing, to], () => {
75
+ // noop
76
+ });
77
77
 
78
78
  const { manifest, headers, redirect } = await this.#resolver.resolve(
79
79
  outgoing,
@@ -118,4 +118,3 @@ const PodiumClientResource = class PodiumClientResource {
118
118
  return 'PodiumClientResource';
119
119
  }
120
120
  };
121
- module.exports = PodiumClientResource;
package/lib/response.js CHANGED
@@ -1,8 +1,6 @@
1
- 'use strict';
2
-
3
1
  const inspect = Symbol.for('nodejs.util.inspect.custom');
4
2
 
5
- const PodiumClientResponse = class PodiumClientResponse {
3
+ export default class PodiumClientResponse {
6
4
  #redirect;
7
5
  #content;
8
6
  #headers;
@@ -78,4 +76,3 @@ const PodiumClientResponse = class PodiumClientResponse {
78
76
  return 'PodiumClientResponse';
79
77
  }
80
78
  };
81
- module.exports = PodiumClientResponse;
package/lib/state.js CHANGED
@@ -1,10 +1,8 @@
1
- 'use strict';
2
-
3
- const EventEmitter = require('events');
1
+ import EventEmitter from 'events';
4
2
 
5
3
  const inspect = Symbol.for('nodejs.util.inspect.custom');
6
4
 
7
- const PodiumClientState = class PodiumClientState extends EventEmitter {
5
+ export default class PodiumClientState extends EventEmitter {
8
6
  #thresholdTimer;
9
7
  #threshold;
10
8
  #maxTimer;
@@ -116,4 +114,3 @@ const PodiumClientState = class PodiumClientState extends EventEmitter {
116
114
  return 'PodiumClientState';
117
115
  }
118
116
  };
119
- module.exports = PodiumClientState;
package/lib/utils.js CHANGED
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  /**
4
2
  * Checks if a header Oject has a header.
5
3
  * Will return true if the header exist and are not an empty
@@ -11,7 +9,7 @@
11
9
  * @returns {Boolean}
12
10
  */
13
11
 
14
- module.exports.isHeaderDefined = (headers, header) => {
12
+ export const isHeaderDefined = (headers, header) => {
15
13
  if (headers[header] === undefined || headers[header].trim() === '') {
16
14
  return false;
17
15
  }
@@ -28,33 +26,10 @@ module.exports.isHeaderDefined = (headers, header) => {
28
26
  * @returns {Boolean}
29
27
  */
30
28
 
31
- module.exports.hasManifestChange = item => {
29
+ export const hasManifestChange = item => {
32
30
  const oldVersion = item.oldVal ? item.oldVal.version : '';
33
31
  const newVersion = item.newVal ? item.newVal.version : '';
34
32
  return oldVersion !== newVersion;
35
33
  };
36
34
 
37
- /**
38
- * Check if a value is a HttpIncoming object or not. If not, it
39
- * assume the incoming value is a context
40
- *
41
- * @param {Object} incoming A object
42
- *
43
- * @returns {HttpIncoming}
44
-
45
-
46
- function incomingDeprecated() {
47
- if (!incomingDeprecated.warned) {
48
- incomingDeprecated.warned = true;
49
- process.emitWarning(
50
- 'Passing an arbitrary value as the first argument to .fetch() and .stream() is deprecated. In a future version it will be required to pass in a HttpIncoming object as a the first argument to these methods. For further information and how to migrate, please see https://podium-lib.io/blog/2019/06/14/version-4.0.0#httpincoming-replaces-context-argument',
51
- 'DeprecationWarning',
52
- );
53
- }
54
- }
55
- */
56
-
57
-
58
- module.exports.validateIncoming = (incoming = {}) => {
59
- return (Object.prototype.toString.call(incoming) === '[object PodiumHttpIncoming]');
60
- };
35
+ export const validateIncoming = (incoming = {}) => (Object.prototype.toString.call(incoming) === '[object PodiumHttpIncoming]');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@podium/client",
3
- "version": "5.0.0-next.6",
4
- "main": "lib/client.js",
3
+ "version": "5.0.0-next.9",
4
+ "type": "module",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "micro services",
@@ -24,49 +24,45 @@
24
24
  "index.d.ts",
25
25
  "README.md",
26
26
  "LICENSE",
27
+ "dist",
27
28
  "lib"
28
29
  ],
30
+ "main": "./lib/client.js",
29
31
  "types": "index.d.ts",
30
32
  "scripts": {
31
33
  "lint": "eslint .",
32
34
  "lint:fix": "eslint --fix .",
33
- "test": "tap --no-esm --no-cov --no-ts --no-jsx test/*.js",
34
- "precommit": "lint-staged"
35
+ "test": "tap --no-check-coverage"
35
36
  },
36
37
  "dependencies": {
37
- "@hapi/boom": "^9.0.0",
38
+ "@hapi/boom": "^10.0.0",
38
39
  "@metrics/client": "2.5.0",
39
- "@podium/schemas": "5.0.0-next.1",
40
- "@podium/utils": "5.0.0-next.2",
40
+ "@podium/schemas": "5.0.0-next.4",
41
+ "@podium/utils": "5.0.0-next.6",
41
42
  "abslog": "2.4.0",
42
43
  "http-cache-semantics": "^4.0.3",
43
44
  "lodash.clonedeep": "^4.5.0",
44
- "readable-stream": "^3.4.0",
45
45
  "request": "^2.88.0",
46
46
  "ttl-mem-cache": "4.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@semantic-release/changelog": "5.0.1",
50
- "@semantic-release/commit-analyzer": "8.0.1",
51
- "@semantic-release/git": "9.0.0",
52
- "@semantic-release/github": "7.0.7",
53
- "@semantic-release/npm": "7.0.5",
54
- "@semantic-release/release-notes-generator": "9.0.1",
55
- "semantic-release": "17.1.1",
56
- "@podium/test-utils": "2.2.0",
57
- "@sinonjs/fake-timers": "6.0.1",
49
+ "@podium/test-utils": "2.5.2",
50
+ "@semantic-release/changelog": "6.0.1",
51
+ "@semantic-release/git": "10.0.1",
52
+ "@sinonjs/fake-timers": "9.1.2",
53
+ "@babel/eslint-parser": "7.17.0",
58
54
  "benchmark": "2.1.4",
59
- "eslint": "7.5.0",
60
- "eslint-config-airbnb-base": "14.2.0",
61
- "eslint-config-prettier": "6.11.0",
62
- "eslint-plugin-import": "2.22.0",
63
- "eslint-plugin-prettier": "3.1.4",
64
- "babel-eslint": "10.1.0",
65
- "express": "4.17.1",
66
- "get-stream": "6.0.0",
55
+ "eslint": "8.15.0",
56
+ "eslint-config-airbnb-base": "15.0.0",
57
+ "eslint-config-prettier": "8.5.0",
58
+ "eslint-plugin-import": "2.26.0",
59
+ "eslint-plugin-prettier": "4.0.0",
60
+ "express": "4.18.1",
61
+ "get-stream": "6.0.1",
67
62
  "http-proxy": "1.18.1",
68
- "is-stream": "2.0.0",
69
- "prettier": "2.0.5",
70
- "tap": "14.10.8"
63
+ "is-stream": "3.0.0",
64
+ "prettier": "2.6.2",
65
+ "semantic-release": "19.0.2",
66
+ "tap": "16.2.0"
71
67
  }
72
68
  }