@podium/client 5.0.0-next.8 → 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,206 @@
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
+
1
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)
2
204
 
3
205
 
4
206
  ### Features
@@ -6,6 +208,9 @@
6
208
  * Use native streams ([#215](https://github.com/podium-lib/client/issues/215)) ([f949c9c](https://github.com/podium-lib/client/commit/f949c9cc0d66431685138ca2c0367aec622bce78))
7
209
 
8
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)
9
214
 
10
215
 
11
216
  ### Bug Fixes
@@ -43,6 +248,99 @@
43
248
  Co-authored-by: Trygve Lie <trygve.lie@finn.no>
44
249
 
45
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
+
46
344
  ## [4.4.19](https://github.com/podium-lib/client/compare/v4.4.18...v4.4.19) (2021-04-27)
47
345
 
48
346
 
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,5 +1,5 @@
1
1
  import EventEmitter from 'events';
2
- import * as schemas from '@podium/schemas';
2
+ import {uriStrict as validateUriStrict, name as validateName } from'@podium/schemas';
3
3
  import Metrics from '@metrics/client';
4
4
  import abslog from 'abslog';
5
5
  import Cache from 'ttl-mem-cache';
@@ -24,6 +24,8 @@ const HTTPS_AGENT_OPTIONS = {
24
24
  maxCachedSessions: 10,
25
25
  };
26
26
 
27
+ const REJECT_UNAUTHORIZED = true;
28
+
27
29
  const HTTP_AGENT = new http.Agent(HTTP_AGENT_OPTIONS);
28
30
 
29
31
  const HTTPS_AGENT = new https.Agent(HTTPS_AGENT_OPTIONS);
@@ -45,7 +47,7 @@ export default class PodiumClient extends EventEmitter {
45
47
  super();
46
48
  const log = abslog(options.logger);
47
49
 
48
- if (schemas.name(options.name).error) {
50
+ if (validateName(options.name).error) {
49
51
  throw new Error(
50
52
  `The value, "${options.name}", for the required argument "name" on the Client constructor is not defined or not valid.`,
51
53
  );
@@ -57,6 +59,7 @@ export default class PodiumClient extends EventEmitter {
57
59
  timeout: TIMEOUT,
58
60
  logger: options.logger,
59
61
  maxAge: MAX_AGE,
62
+ rejectUnauthorized: REJECT_UNAUTHORIZED,
60
63
  httpAgent: HTTP_AGENT,
61
64
  httpsAgent: HTTPS_AGENT,
62
65
  ...options,
@@ -126,12 +129,12 @@ export default class PodiumClient extends EventEmitter {
126
129
  }
127
130
 
128
131
  register(options = {}) {
129
- if (schemas.name(options.name).error)
132
+ if (validateName(options.name).error)
130
133
  throw new Error(
131
134
  `The value, "${options.name}", for the required argument "name" on the .register() method is not defined or not valid.`,
132
135
  );
133
136
 
134
- if (schemas.uriStrict(options.uri).error)
137
+ if (validateUriStrict(options.uri).error)
135
138
  throw new Error(
136
139
  `The value, "${options.uri}", for the required argument "uri" on the .register() method is not defined or not valid.`,
137
140
  );
@@ -143,14 +146,14 @@ export default class PodiumClient extends EventEmitter {
143
146
  }
144
147
 
145
148
  const resourceOptions = {
149
+ rejectUnauthorized: this.#options.rejectUnauthorized,
146
150
  clientName: this.#options.name,
147
151
  retries: this.#options.retries,
148
152
  timeout: this.#options.timeout,
149
153
  logger: this.#options.logger,
150
154
  maxAge: this.#options.maxAge,
151
- agent: options.uri.startsWith('https://')
152
- ? this.#options.httpsAgent
153
- : this.#options.httpAgent,
155
+ httpsAgent: this.#options.httpsAgent,
156
+ httpAgent: this.#options.httpAgent,
154
157
  ...options,
155
158
  };
156
159
  const resource = new Resource(
@@ -4,6 +4,7 @@ import { PassThrough } from 'stream';
4
4
  import assert from 'assert';
5
5
 
6
6
  export default class PodletClientHttpOutgoing extends PassThrough {
7
+ #rejectUnauthorized;
7
8
  #killRecursions;
8
9
  #killThreshold;
9
10
  #redirectable;
@@ -21,6 +22,7 @@ export default class PodletClientHttpOutgoing extends PassThrough {
21
22
  #uri;
22
23
  constructor(
23
24
  {
25
+ rejectUnauthorized = true,
24
26
  throwable = false,
25
27
  redirectable = false,
26
28
  retries = 4,
@@ -39,6 +41,9 @@ export default class PodletClientHttpOutgoing extends PassThrough {
39
41
  'you must pass a URI in "options.uri" to the HttpOutgoing constructor',
40
42
  );
41
43
 
44
+ // If requests to https sites should reject on unsigned sertificates
45
+ this.#rejectUnauthorized = rejectUnauthorized;
46
+
42
47
  // A HttpIncoming object
43
48
  this.#incoming = incoming;
44
49
 
@@ -100,6 +105,10 @@ export default class PodletClientHttpOutgoing extends PassThrough {
100
105
  this.#redirect = null;
101
106
  }
102
107
 
108
+ get rejectUnauthorized() {
109
+ return this.#rejectUnauthorized;
110
+ }
111
+
103
112
  get reqOptions() {
104
113
  return this.#reqOptions;
105
114
  }
@@ -22,13 +22,15 @@ const UA_STRING = `${pkg.name} ${pkg.version}`;
22
22
 
23
23
  export default class PodletClientContentResolver {
24
24
  #log;
25
- #agent;
26
25
  #metrics;
27
26
  #histogram;
27
+ #httpAgent;
28
+ #httpsAgent;
28
29
  constructor(options = {}) {
29
30
  const name = options.clientName;
30
31
  this.#log = abslog(options.logger);
31
- this.#agent = options.agent;
32
+ this.#httpAgent = options.httpAgent;
33
+ this.#httpsAgent = options.httpsAgent;
32
34
  this.#metrics = new Metrics();
33
35
  this.#histogram = this.#metrics.histogram({
34
36
  name: 'podium_client_resolver_content_resolve',
@@ -105,9 +107,12 @@ export default class PodletClientContentResolver {
105
107
  putils.serializeContext(headers, outgoing.context, outgoing.name);
106
108
 
107
109
  const reqOptions = {
110
+ rejectUnauthorized: outgoing.rejectUnauthorized,
108
111
  timeout: outgoing.timeout,
109
112
  method: 'GET',
110
- agent: this.#agent,
113
+ agent: outgoing.contentUri.startsWith('https://')
114
+ ? this.#httpsAgent
115
+ : this.#httpAgent,
111
116
  uri: putils.uriBuilder(
112
117
  outgoing.reqOptions.pathname,
113
118
  outgoing.contentUri,
@@ -17,14 +17,16 @@ const UA_STRING = `${pkg.name} ${pkg.version}`;
17
17
 
18
18
  export default class PodletClientFallbackResolver {
19
19
  #log;
20
- #agent;
21
20
  #metrics;
22
21
  #histogram;
22
+ #httpAgent;
23
+ #httpsAgent;
23
24
  constructor(options = {}) {
24
25
  const name = options.clientName;
25
26
  this.#log = abslog(options.logger);
26
- this.#agent = options.agent;
27
27
  this.#metrics = new Metrics();
28
+ this.#httpAgent = options.httpAgent;
29
+ this.#httpsAgent = options.httpsAgent;
28
30
  this.#histogram = this.#metrics.histogram({
29
31
  name: 'podium_client_resolver_fallback_resolve',
30
32
  description: 'Time taken for success/failure of fallback request',
@@ -35,7 +37,7 @@ export default class PodletClientFallbackResolver {
35
37
  },
36
38
  buckets: [0.001, 0.01, 0.1, 0.5, 1, 2, 10],
37
39
  });
38
-
40
+
39
41
  this.#metrics.on('error', error => {
40
42
  this.#log.error(
41
43
  'Error emitted by metric stream in @podium/client module',
@@ -80,9 +82,12 @@ export default class PodletClientFallbackResolver {
80
82
  };
81
83
 
82
84
  const reqOptions = {
85
+ rejectUnauthorized: outgoing.rejectUnauthorized,
83
86
  timeout: outgoing.timeout,
84
87
  method: 'GET',
85
- agent: this.#agent,
88
+ agent: outgoing.fallbackUri.startsWith('https://')
89
+ ? this.#httpsAgent
90
+ : this.#httpAgent,
86
91
  uri: outgoing.fallbackUri,
87
92
  headers,
88
93
  };
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-param-reassign */
2
2
 
3
3
  import CachePolicy from 'http-cache-semantics';
4
- import * as schemas from'@podium/schemas';
4
+ import {manifest as validateManifest } from'@podium/schemas';
5
5
  import request from 'request';
6
6
  import Metrics from '@metrics/client';
7
7
  import abslog from 'abslog';
@@ -20,14 +20,16 @@ const UA_STRING = `${pkg.name} ${pkg.version}`;
20
20
 
21
21
  export default class PodletClientManifestResolver {
22
22
  #log;
23
- #agent;
24
23
  #metrics;
24
+ #httpAgent;
25
+ #httpsAgent;
25
26
  #histogram;
26
27
  constructor(options = {}) {
27
28
  const name = options.clientName;
28
29
  this.#log = abslog(options.logger);
29
- this.#agent = options.agent;
30
30
  this.#metrics = new Metrics();
31
+ this.#httpAgent = options.httpAgent;
32
+ this.#httpsAgent = options.httpsAgent;
31
33
  this.#histogram = this.#metrics.histogram({
32
34
  name: 'podium_client_resolver_manifest_resolve',
33
35
  description: 'Time taken for success/failure of manifest request',
@@ -63,9 +65,12 @@ export default class PodletClientManifestResolver {
63
65
  };
64
66
 
65
67
  const reqOptions = {
68
+ rejectUnauthorized: outgoing.rejectUnauthorized,
66
69
  timeout: outgoing.timeout,
67
70
  method: 'GET',
68
- agent: this.#agent,
71
+ agent: outgoing.manifestUri.startsWith('https://')
72
+ ? this.#httpsAgent
73
+ : this.#httpAgent,
69
74
  json: true,
70
75
  uri: outgoing.manifestUri,
71
76
  headers,
@@ -113,7 +118,7 @@ export default class PodletClientManifestResolver {
113
118
  return;
114
119
  }
115
120
 
116
- const manifest = schemas.manifest(body);
121
+ const manifest = validateManifest(body);
117
122
 
118
123
  // Manifest validation error
119
124
  if (manifest.error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podium/client",
3
- "version": "5.0.0-next.8",
3
+ "version": "5.0.0-next.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -27,21 +27,15 @@
27
27
  "dist",
28
28
  "lib"
29
29
  ],
30
- "main": "./dist/client.js",
31
- "exports": {
32
- "require": "./dist/client.js",
33
- "import": "./lib/client.js"
34
- },
30
+ "main": "./lib/client.js",
35
31
  "types": "index.d.ts",
36
32
  "scripts": {
37
33
  "lint": "eslint .",
38
34
  "lint:fix": "eslint --fix .",
39
- "test": "tap --no-check-coverage",
40
- "prepare": "npm run -s build",
41
- "build": "rollup -c"
35
+ "test": "tap --no-check-coverage"
42
36
  },
43
37
  "dependencies": {
44
- "@hapi/boom": "^9.0.0",
38
+ "@hapi/boom": "^10.0.0",
45
39
  "@metrics/client": "2.5.0",
46
40
  "@podium/schemas": "5.0.0-next.4",
47
41
  "@podium/utils": "5.0.0-next.6",
@@ -52,27 +46,23 @@
52
46
  "ttl-mem-cache": "4.1.0"
53
47
  },
54
48
  "devDependencies": {
55
- "@podium/test-utils": "2.3.0",
56
- "@semantic-release/changelog": "5.0.1",
57
- "@semantic-release/commit-analyzer": "8.0.1",
58
- "@semantic-release/git": "9.0.0",
59
- "@semantic-release/github": "7.2.1",
60
- "@semantic-release/npm": "7.1.1",
61
- "@semantic-release/release-notes-generator": "9.0.2",
62
- "@sinonjs/fake-timers": "7.0.5",
63
- "babel-eslint": "10.1.0",
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",
64
54
  "benchmark": "2.1.4",
65
- "eslint": "7.25.0",
66
- "eslint-config-airbnb-base": "14.2.1",
67
- "eslint-config-prettier": "8.3.0",
68
- "eslint-plugin-import": "2.22.1",
69
- "eslint-plugin-prettier": "3.4.0",
70
- "express": "4.17.1",
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",
71
61
  "get-stream": "6.0.1",
72
62
  "http-proxy": "1.18.1",
73
- "prettier": "2.2.1",
74
- "rollup": "2.46.0",
75
- "semantic-release": "17.4.2",
76
- "tap": "15.0.6"
63
+ "is-stream": "3.0.0",
64
+ "prettier": "2.6.2",
65
+ "semantic-release": "19.0.2",
66
+ "tap": "16.2.0"
77
67
  }
78
68
  }