@clairejs/client 3.5.6 → 3.5.8

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/README.md CHANGED
@@ -1,574 +1,579 @@
1
1
  ## Change Log
2
2
 
3
+ #### 3.5.8:
4
+
5
+ - fix default http client clone
6
+ - implement http client clone
7
+
3
8
  #### 3.5.6:
4
9
 
5
- - add id field to mergeInstances
10
+ - add id field to mergeInstances
6
11
 
7
12
  #### 3.5.5:
8
13
 
9
- - improve RefreshHttpClient refreshToken
14
+ - improve RefreshHttpClient refreshToken
10
15
 
11
16
  #### 3.5.4:
12
17
 
13
- - improve crud api cache
18
+ - improve crud api cache
14
19
 
15
20
  #### 3.5.2:
16
21
 
17
- - update abstract storage interface
22
+ - update abstract storage interface
18
23
 
19
24
  #### 3.5.1:
20
25
 
21
- - fix http client handle expired refresh token
22
- - refactor http client
26
+ - fix http client handle expired refresh token
27
+ - refactor http client
23
28
 
24
29
  #### 3.4.6:
25
30
 
26
- - update RouterConfig to allow arbitrary field
27
- - update packages
31
+ - update RouterConfig to allow arbitrary field
32
+ - update packages
28
33
 
29
34
  #### 3.4.5:
30
35
 
31
- - fix Translator awaitingTranslations
36
+ - fix Translator awaitingTranslations
32
37
 
33
38
  #### 3.4.4:
34
39
 
35
- - update claire core
36
- - fix mergeInstances not merge null
37
- - fix http client cache headers
38
- - update claire core
39
- - apply LogHandler to some implementations
40
+ - update claire core
41
+ - fix mergeInstances not merge null
42
+ - fix http client cache headers
43
+ - update claire core
44
+ - apply LogHandler to some implementations
40
45
 
41
46
  #### 3.3.3:
42
47
 
43
- - update claire core
44
- - export getAPI utils
45
- - remove webpack, change module to esm
48
+ - update claire core
49
+ - export getAPI utils
50
+ - remove webpack, change module to esm
46
51
 
47
52
  #### 3.2.33:
48
53
 
49
- - fix return type of updateRecords
50
- - add updateRecords in crud api
54
+ - fix return type of updateRecords
55
+ - add updateRecords in crud api
51
56
 
52
57
  #### 3.2.29:
53
58
 
54
- - update claire core
59
+ - update claire core
55
60
 
56
61
  #### 3.2.28:
57
62
 
58
- - fix refresh http client wait for refresh token
63
+ - fix refresh http client wait for refresh token
59
64
 
60
65
  #### 3.2.27:
61
66
 
62
- - fix error handle in http clients
67
+ - fix error handle in http clients
63
68
 
64
69
  #### 3.2.26:
65
70
 
66
- - add cache ability to DefaultHttpClient (for use in non-browser env)
71
+ - add cache ability to DefaultHttpClient (for use in non-browser env)
67
72
 
68
73
  #### 3.2.25:
69
74
 
70
- - new implementation of http clients
75
+ - new implementation of http clients
71
76
 
72
77
  #### 3.2.23:
73
78
 
74
- - simple implementation of RefreshHttpClient error handler without recursion
79
+ - simple implementation of RefreshHttpClient error handler without recursion
75
80
 
76
81
  #### 3.2.22:
77
82
 
78
- - AbstractHttpClient operations return undefined in case error handler intercepted
83
+ - AbstractHttpClient operations return undefined in case error handler intercepted
79
84
 
80
85
  #### 3.2.21:
81
86
 
82
- - fix refresh http client clear access token before refreshing
83
- - fix refresh http client infinite loop
84
- - pump axios version
87
+ - fix refresh http client clear access token before refreshing
88
+ - fix refresh http client infinite loop
89
+ - pump axios version
85
90
 
86
91
  #### 3.2.19:
87
92
 
88
- - fix http client get method
93
+ - fix http client get method
89
94
 
90
95
  #### 3.2.18:
91
96
 
92
- - update claire core with new Errors
93
- - refactor HttpClient
97
+ - update claire core with new Errors
98
+ - refactor HttpClient
94
99
 
95
100
  #### 3.2.17:
96
101
 
97
- - update claire core
98
- - fix mergeInstance type issue Partial -> DeepPartial
102
+ - update claire core
103
+ - fix mergeInstance type issue Partial -> DeepPartial
99
104
 
100
105
  #### 3.2.16:
101
106
 
102
- - move reset cache to AbstractHttpClient
107
+ - move reset cache to AbstractHttpClient
103
108
 
104
109
  #### 3.2.15:
105
110
 
106
- - remove ws
107
- - remove rxjs
108
- - update core, fix returning in update many
111
+ - remove ws
112
+ - remove rxjs
113
+ - update core, fix returning in update many
109
114
 
110
115
  #### 3.2.12:
111
116
 
112
- - update core package, adapt abstract model id field data type change
117
+ - update core package, adapt abstract model id field data type change
113
118
 
114
119
  #### 3.2.11:
115
120
 
116
- - update core package
117
- - improve mergeInstances to be aware of @HasMany
121
+ - update core package
122
+ - improve mergeInstances to be aware of @HasMany
118
123
 
119
124
  #### 3.2.4:
120
125
 
121
- - fix RefreshHttpClient bug in getting refresh token condition
126
+ - fix RefreshHttpClient bug in getting refresh token condition
122
127
 
123
128
  #### 3.2.3:
124
129
 
125
- - fix translate undefined/null/empty template
126
- - update Translator.translate to return string instead of promise
127
- - fix translation loading translation pending promises
128
- - implement new Translator
130
+ - fix translate undefined/null/empty template
131
+ - update Translator.translate to return string instead of promise
132
+ - fix translation loading translation pending promises
133
+ - implement new Translator
129
134
 
130
135
  #### 3.1.26:
131
136
 
132
- - fix DefaultHttpClient retry
133
- - add retry config in RefreshHttpClient
134
- - fix stringifyQueries not encode URI
135
- - add withCredentials option to abstract request
137
+ - fix DefaultHttpClient retry
138
+ - add retry config in RefreshHttpClient
139
+ - fix stringifyQueries not encode URI
140
+ - add withCredentials option to abstract request
136
141
 
137
142
  #### 3.1.22:
138
143
 
139
- - fix DefaultHttpClient: add delay before retry
140
- - fix stringifyQueries
141
- - add cache and reset cache ability to DefaultHttpClient
142
- - fix HttpClient, allow get with cache, allow retry when get 503 error
144
+ - fix DefaultHttpClient: add delay before retry
145
+ - fix stringifyQueries
146
+ - add cache and reset cache ability to DefaultHttpClient
147
+ - fix HttpClient, allow get with cache, allow retry when get 503 error
143
148
 
144
149
  #### 3.1.15:
145
150
 
146
- - mergeInstance accept Identifiable class instead of AbstractModel
151
+ - mergeInstance accept Identifiable class instead of AbstractModel
147
152
 
148
153
  #### 3.1.14:
149
154
 
150
- - using deepMerge for mergeInstances
155
+ - using deepMerge for mergeInstances
151
156
 
152
157
  #### 3.1.13:
153
158
 
154
- - send & handle socket READY message
155
- - update Translator
156
- - fix socket terminated not calling disconnection handler error
157
- - fix typo in socket config
159
+ - send & handle socket READY message
160
+ - update Translator
161
+ - fix socket terminated not calling disconnection handler error
162
+ - fix typo in socket config
158
163
 
159
164
  #### 3.1.5:
160
165
 
161
- - add get pingpong info
162
- - fix resolve header promise in api client
163
- - add IWebsocket onclose error handler
164
- - fix rejoin channel when socket disconnect un-intentionally
165
- - fix join channel when socket is not available
166
- - refactor client socket & socket manager
166
+ - add get pingpong info
167
+ - fix resolve header promise in api client
168
+ - add IWebsocket onclose error handler
169
+ - fix rejoin channel when socket disconnect un-intentionally
170
+ - fix join channel when socket is not available
171
+ - refactor client socket & socket manager
167
172
 
168
173
  #### 3.0.17:
169
174
 
170
- - AxiosApiClient -> RefreshHttpClient
171
- - Add DefaultHttpClient (axios)
175
+ - AxiosApiClient -> RefreshHttpClient
176
+ - Add DefaultHttpClient (axios)
172
177
 
173
178
  #### 3.0.16:
174
179
 
175
- - fix AbstractHttpClient header case-sensitive issue
180
+ - fix AbstractHttpClient header case-sensitive issue
176
181
 
177
182
  #### 3.0.14:
178
183
 
179
- - fix catch issue when cannot refresh token
184
+ - fix catch issue when cannot refresh token
180
185
 
181
186
  #### 3.0.13:
182
187
 
183
- - fix mergeInstance
188
+ - fix mergeInstance
184
189
 
185
190
  #### 3.0.12:
186
191
 
187
- - add default storage key for token manager
192
+ - add default storage key for token manager
188
193
 
189
194
  #### 3.0.11:
190
195
 
191
- - fix AbstractHttpClient refresh token
196
+ - fix AbstractHttpClient refresh token
192
197
 
193
198
  #### 3.0.10:
194
199
 
195
- - fix export
196
- - fix CrudApi
200
+ - fix export
201
+ - fix CrudApi
197
202
 
198
203
  #### 3.0.7:
199
204
 
200
- - add DefaultTokenManager
201
- - add CrudApi
205
+ - add DefaultTokenManager
206
+ - add CrudApi
202
207
 
203
208
  #### 3.0.6: update url info
204
209
 
205
- - add hash
206
- - update view middware: from is nullable
210
+ - add hash
211
+ - update view middware: from is nullable
207
212
 
208
213
  #### 3.0.4: update translation
209
214
 
210
- - Translator is now in charge of mapping translation (getTranslationObject)
211
- - translation template supports function expression
212
- - translator has language update subscribers registry
215
+ - Translator is now in charge of mapping translation (getTranslationObject)
216
+ - translation template supports function expression
217
+ - translator has language update subscribers registry
213
218
 
214
219
  #### 3.0.0
215
220
 
216
- - update claire core 3.0
217
- - remove AbstractRouter
221
+ - update claire core 3.0
222
+ - remove AbstractRouter
218
223
 
219
224
  #### 2.2.5
220
225
 
221
- - update core, remove crud router
226
+ - update core, remove crud router
222
227
 
223
228
  #### 2.2.4
224
229
 
225
- - use socket provider for DefaultClientSocketManager instead of native WebSocket
230
+ - use socket provider for DefaultClientSocketManager instead of native WebSocket
226
231
 
227
232
  #### 2.2.1
228
233
 
229
- - revert to WebSocket implementation (because API gateway only support native websocket)
234
+ - revert to WebSocket implementation (because API gateway only support native websocket)
230
235
 
231
236
  #### 2.1.24
232
237
 
233
- - downgrade webpack
238
+ - downgrade webpack
234
239
 
235
240
  #### 2.1.23
236
241
 
237
- - fix socket not reconnect due to refresh token was obtained after socket was closed
242
+ - fix socket not reconnect due to refresh token was obtained after socket was closed
238
243
 
239
244
  #### 2.1.22
240
245
 
241
- - remove socket manager initial connect
246
+ - remove socket manager initial connect
242
247
 
243
248
  #### 2.1.21
244
249
 
245
- - add type support for api provider
250
+ - add type support for api provider
246
251
 
247
252
  #### 2.1.19
248
253
 
249
- - forceReconnect when cannot get access token
254
+ - forceReconnect when cannot get access token
250
255
 
251
256
  #### 2.1.18
252
257
 
253
- - update claire core 2.1.2
254
- - fix not connect with undefined access token
255
- - add forceDisconnect to AbstractClientSocketManager
258
+ - update claire core 2.1.2
259
+ - fix not connect with undefined access token
260
+ - add forceDisconnect to AbstractClientSocketManager
256
261
 
257
262
  #### 2.1.17
258
263
 
259
- - fix socket connect not processing success result
264
+ - fix socket connect not processing success result
260
265
 
261
266
  #### 2.1.16
262
267
 
263
- - update claire core
268
+ - update claire core
264
269
 
265
270
  #### 2.1.13
266
271
 
267
- - remove encodeURI as socket data
272
+ - remove encodeURI as socket data
268
273
 
269
274
  #### 2.1.11
270
275
 
271
- - client socket to send encodedURI as data
276
+ - client socket to send encodedURI as data
272
277
 
273
278
  #### 2.1.9
274
279
 
275
- - use rxJs to implement client socket logic
280
+ - use rxJs to implement client socket logic
276
281
 
277
282
  #### 2.0.24:
278
283
 
279
- - remove test token manager
280
- - fix forceSocket reconnect
284
+ - remove test token manager
285
+ - fix forceSocket reconnect
281
286
 
282
287
  #### 2.0.12:
283
288
 
284
- - add test token manager
289
+ - add test token manager
285
290
 
286
291
  #### 2.0.10:
287
292
 
288
- - add AbstractTokenManager, refresh token mechanism for http and socket
293
+ - add AbstractTokenManager, refresh token mechanism for http and socket
289
294
 
290
295
  #### 2.0.7:
291
296
 
292
- - update claire core
297
+ - update claire core
293
298
 
294
299
  #### 2.0.6:
295
300
 
296
- - use DI for view middleware in router config
297
- - update peer dependencies
298
- - update abstract view middleware signature
301
+ - use DI for view middleware in router config
302
+ - update peer dependencies
303
+ - update abstract view middleware signature
299
304
 
300
305
  #### 2.0.2:
301
306
 
302
- - use Claire Core 2.0
303
- - add log to Axios api client
307
+ - use Claire Core 2.0
308
+ - add log to Axios api client
304
309
 
305
310
  #### 1.6.55:
306
311
 
307
- - add socket keep alive ping/pong
312
+ - add socket keep alive ping/pong
308
313
 
309
314
  #### 1.6.50:
310
315
 
311
- - fix build script
312
- - update clairejs/core
316
+ - fix build script
317
+ - update clairejs/core
313
318
 
314
319
  #### 1.6.48 (Breaking change):
315
320
 
316
- - add socket multiplex
321
+ - add socket multiplex
317
322
 
318
323
  #### 1.6.28:
319
324
 
320
- - fix disconnection event not called when socket disconnect
325
+ - fix disconnection event not called when socket disconnect
321
326
 
322
327
  #### 1.6.25:
323
328
 
324
- - split logic of translation into LocaleTranslator
329
+ - split logic of translation into LocaleTranslator
325
330
 
326
331
  #### 1.6.24:
327
332
 
328
- - add ClientSocket unsubscriber function as return result of onXXX listeners
333
+ - add ClientSocket unsubscriber function as return result of onXXX listeners
329
334
 
330
335
  #### 1.6.23:
331
336
 
332
- - add getAllSockets in SocketProvider
333
- - fix socket provider not remove disconnected sockets
334
- - add ClientSocket.isReconnecting
337
+ - add getAllSockets in SocketProvider
338
+ - fix socket provider not remove disconnected sockets
339
+ - add ClientSocket.isReconnecting
335
340
 
336
341
  #### 1.6.17:
337
342
 
338
- - fix socket getAuthId => getAuthInfo
343
+ - fix socket getAuthId => getAuthInfo
339
344
 
340
345
  #### 1.6.16:
341
346
 
342
- - add socket provider to claire client
347
+ - add socket provider to claire client
343
348
 
344
349
  #### 1.6.14:
345
350
 
346
- - fix client socket multiple handlers
351
+ - fix client socket multiple handlers
347
352
 
348
353
  #### 1.6.12:
349
354
 
350
- - add ClientSocket and SocketProvider
355
+ - add ClientSocket and SocketProvider
351
356
 
352
357
  #### 1.6.11:
353
358
 
354
- - ClientSocket logger optional
359
+ - ClientSocket logger optional
355
360
 
356
361
  #### 1.6.10:
357
362
 
358
- - ClientSocket connection retry
363
+ - ClientSocket connection retry
359
364
 
360
365
  #### 1.6.7:
361
366
 
362
- - fix ClientSocket
367
+ - fix ClientSocket
363
368
 
364
369
  #### 1.6.5:
365
370
 
366
- - export and fix ClientSocket
371
+ - export and fix ClientSocket
367
372
 
368
373
  #### 1.6.3:
369
374
 
370
- - detach vue code into separate package
371
- - add nodeExternals
375
+ - detach vue code into separate package
376
+ - add nodeExternals
372
377
 
373
378
  #### 1.6.0:
374
379
 
375
- - revert back to 1.4.16
380
+ - revert back to 1.4.16
376
381
 
377
382
  #### 1.4.16:
378
383
 
379
- - update claire core
384
+ - update claire core
380
385
 
381
386
  #### 1.4.15:
382
387
 
383
- - export protected convertQueryObjectToString
388
+ - export protected convertQueryObjectToString
384
389
 
385
390
  #### 1.4.14:
386
391
 
387
- - remove unused styling
392
+ - remove unused styling
388
393
 
389
394
  #### 1.4.13:
390
395
 
391
- - update VuexCrudModule merge create model instance
396
+ - update VuexCrudModule merge create model instance
392
397
 
393
398
  #### 1.4.12:
394
399
 
395
- - vuexCrudModule default sort by id
400
+ - vuexCrudModule default sort by id
396
401
 
397
402
  #### 1.4.11:
398
403
 
399
- - fix crud logic populate server value field
404
+ - fix crud logic populate server value field
400
405
 
401
406
  #### 1.4.10:
402
407
 
403
- - update claire core
404
- - update crud logic
408
+ - update claire core
409
+ - update crud logic
405
410
 
406
411
  #### 1.4.9:
407
412
 
408
- - reset editItem in CrudLogic
413
+ - reset editItem in CrudLogic
409
414
 
410
415
  #### 1.4.8:
411
416
 
412
- - fix reading data from undefined response in AxiosApiProvider
417
+ - fix reading data from undefined response in AxiosApiProvider
413
418
 
414
419
  #### 1.4.6:
415
420
 
416
- - remove redudant AbstractErrorHandler
421
+ - remove redudant AbstractErrorHandler
417
422
 
418
423
  #### 1.4.5:
419
424
 
420
- - introduce CrudLogic and scss
425
+ - introduce CrudLogic and scss
421
426
 
422
427
  #### 1.4.4:
423
428
 
424
- - fix VuexCrudModule.decache async return
425
- - return removed instances from VuexCrudModule.decache
429
+ - fix VuexCrudModule.decache async return
430
+ - return removed instances from VuexCrudModule.decache
426
431
 
427
432
  #### 1.4.2:
428
433
 
429
- - adjust AbstractCrudRouter
434
+ - adjust AbstractCrudRouter
430
435
 
431
436
  #### 1.4.1:
432
437
 
433
- - update claire core
434
- - public mutation method in VuexCrudModule
438
+ - update claire core
439
+ - public mutation method in VuexCrudModule
435
440
 
436
441
  #### 1.4.0:
437
442
 
438
- - move VuexCrudModule and VueCrudRouter into
439
- - add getModule into VueHandler
443
+ - move VuexCrudModule and VueCrudRouter into
444
+ - add getModule into VueHandler
440
445
 
441
446
  #### 1.3.29:
442
447
 
443
- - update navigation with validated query
448
+ - update navigation with validated query
444
449
 
445
450
  #### 1.3.27:
446
451
 
447
- - update claire core
452
+ - update claire core
448
453
 
449
454
  #### 1.3.26:
450
455
 
451
- - renove onHandleChange listener of VueHandler, use @Watch("\$route") on component instead
456
+ - renove onHandleChange listener of VueHandler, use @Watch("\$route") on component instead
452
457
 
453
458
  #### 1.3.25:
454
459
 
455
- - fix VueHandler url change listener callback from beforeEach to afterEach
460
+ - fix VueHandler url change listener callback from beforeEach to afterEach
456
461
 
457
462
  #### 1.3.24:
458
463
 
459
- - inject error handler in VueHandler
464
+ - inject error handler in VueHandler
460
465
 
461
466
  #### 1.3.23:
462
467
 
463
- - rename App to Navigator
468
+ - rename App to Navigator
464
469
 
465
470
  #### 1.3.20:
466
471
 
467
- - add vuex-class-modules
472
+ - add vuex-class-modules
468
473
 
469
474
  #### 1.3.19:
470
475
 
471
- - update ViewHandler getUrlInfo
472
- - allow ViewHandler navigate relative
473
- - force update vue instance after change language
476
+ - update ViewHandler getUrlInfo
477
+ - allow ViewHandler navigate relative
478
+ - force update vue instance after change language
474
479
 
475
480
  #### 1.3.18:
476
481
 
477
- - fix language init
482
+ - fix language init
478
483
 
479
484
  #### 1.3.17:
480
485
 
481
- - add getCurrentLanguage to VueHandler
486
+ - add getCurrentLanguage to VueHandler
482
487
 
483
488
  #### 1.3.15 (Breaking change):
484
489
 
485
- - adjust RouterConfig
490
+ - adjust RouterConfig
486
491
 
487
492
  #### 1.3.11:
488
493
 
489
- - fix named components in RouterConfig
494
+ - fix named components in RouterConfig
490
495
 
491
496
  #### 1.3.8:
492
497
 
493
- - add named components to RouterConfig
494
- - add components property to RouterConfig
498
+ - add named components to RouterConfig
499
+ - add components property to RouterConfig
495
500
 
496
501
  #### 1.3.7 (Breaking change):
497
502
 
498
- - remove middleware from AbstractRouter
503
+ - remove middleware from AbstractRouter
499
504
 
500
505
  #### 1.3.6:
501
506
 
502
- - update RouterConfig to have nested config
507
+ - update RouterConfig to have nested config
503
508
 
504
509
  #### 1.3.5:
505
510
 
506
- - upgrade clairejs core
511
+ - upgrade clairejs core
507
512
 
508
513
  #### 1.3.4:
509
514
 
510
- - update VueHandler config options, remove @Router decorator
515
+ - update VueHandler config options, remove @Router decorator
511
516
 
512
517
  #### 1.3.1:
513
518
 
514
- - new history, use vue-cli-service library build
519
+ - new history, use vue-cli-service library build
515
520
 
516
521
  #### 1.2.9:
517
522
 
518
- - removal of rootComponentClass
519
- - fix optimizeSSR: false
520
- - add Crud views
523
+ - removal of rootComponentClass
524
+ - fix optimizeSSR: false
525
+ - add Crud views
521
526
 
522
527
  #### 1.2.5 (Breaking change):
523
528
 
524
- - AbstractRouter getRoutes() type change
529
+ - AbstractRouter getRoutes() type change
525
530
 
526
531
  #### 1.2.4:
527
532
 
528
- - improve client builder
533
+ - improve client builder
529
534
 
530
535
  #### 1.2.1:
531
536
 
532
- - adapt rework of claire core
537
+ - adapt rework of claire core
533
538
 
534
539
  #### 1.1.8:
535
540
 
536
- - fix nested translation
541
+ - fix nested translation
537
542
 
538
543
  #### 1.1.3:
539
544
 
540
- - update VuexCrudModule
541
- - use listener in AbstractViewHandler for url change event
545
+ - update VuexCrudModule
546
+ - use listener in AbstractViewHandler for url change event
542
547
 
543
548
  #### 1.1.0:
544
549
 
545
- - use template for translation
550
+ - use template for translation
546
551
 
547
552
  #### 1.0.13:
548
553
 
549
- - set build target es6
550
- - remove vue-i18n
554
+ - set build target es6
555
+ - remove vue-i18n
551
556
 
552
557
  #### 1.0.12:
553
558
 
554
- - introduce bootstrap
559
+ - introduce bootstrap
555
560
 
556
561
  #### 1.0.11:
557
562
 
558
- - allow module injection inside module
563
+ - allow module injection inside module
559
564
 
560
565
  #### 1.0.8:
561
566
 
562
- - update AbstractViewHandler forward with UrlInfo
567
+ - update AbstractViewHandler forward with UrlInfo
563
568
 
564
569
  #### 1.0.5:
565
570
 
566
- - add getUrlInfo in AbstractViewHandler
571
+ - add getUrlInfo in AbstractViewHandler
567
572
 
568
573
  #### 1.0.4:
569
574
 
570
- - remove scss and default App.vue
575
+ - remove scss and default App.vue
571
576
 
572
577
  #### 1.0.3:
573
578
 
574
- - update translation resolver
579
+ - update translation resolver
@@ -9,4 +9,5 @@ export declare abstract class AbstractHttpClient {
9
9
  abstract post<T = any, R = any>(url: string, body: R, headers?: object, options?: RequestOptions): Promise<T | undefined>;
10
10
  abstract put<T = any, R = any>(url: string, body: R, headers?: object, options?: RequestOptions): Promise<T | undefined>;
11
11
  abstract delete<T = any>(url: string, headers?: object, options?: RequestOptions): Promise<T | undefined>;
12
+ abstract clone(apiServerUrl: string): AbstractHttpClient;
12
13
  }
@@ -1,7 +1,7 @@
1
1
  import { Method } from "axios";
2
2
  import { LogHandler } from "@clairejs/core";
3
- import { AbstractHttpClient, RequestOptions } from "./AbstractHttpClient";
4
3
  import { AbstractStorage } from "../system/AbstractStorage";
4
+ import { AbstractHttpClient, RequestOptions } from "./AbstractHttpClient";
5
5
  export interface RequestData {
6
6
  method: Method;
7
7
  url: string;
@@ -9,7 +9,7 @@ export interface RequestData {
9
9
  headers?: object;
10
10
  options?: RequestOptions;
11
11
  }
12
- export declare abstract class DefaultHttpClient extends AbstractHttpClient {
12
+ export declare class DefaultHttpClient extends AbstractHttpClient {
13
13
  protected readonly apiServerUrl: string;
14
14
  protected readonly logger?: LogHandler | undefined;
15
15
  protected readonly maxRetryCount: number;
@@ -20,12 +20,13 @@ export declare abstract class DefaultHttpClient extends AbstractHttpClient {
20
20
  constructor(apiServerUrl: string, logger?: LogHandler | undefined, maxRetryCount?: number, delayMsBetweenRetry?: number, storage?: AbstractStorage | undefined);
21
21
  resetCache(pattern: string): void;
22
22
  protected resolveUrl(url: string): Promise<string>;
23
- protected abstract getAuthorizationHeader(): Promise<Record<string, string>>;
24
- protected abstract errorHandler<T = any>(_operation: () => Promise<T>, err: any): Promise<T | undefined>;
23
+ protected getAuthorizationHeader(): Promise<Record<string, string>>;
24
+ protected errorHandler<T = any>(_operation: () => Promise<T>, err: any): Promise<T | undefined>;
25
25
  protected retry<T = any>(apiCall: () => Promise<T>, retryCount?: number): Promise<T | undefined>;
26
26
  protected performRequest<T = any>(data: RequestData): Promise<T | undefined>;
27
27
  get<T = any>(url: string, headers?: object, options?: RequestOptions): Promise<T | undefined>;
28
28
  post<T = any, R = any>(url: string, body: R, headers?: object, options?: RequestOptions): Promise<T | undefined>;
29
29
  put<T = any, R = any>(url: string, body: R, headers?: object, options?: RequestOptions): Promise<T | undefined>;
30
30
  delete<T = any>(url: string, headers?: object, options?: RequestOptions): Promise<T | undefined>;
31
+ clone(apiServerUrl: string): AbstractHttpClient;
31
32
  }
@@ -64,6 +64,12 @@ export class DefaultHttpClient extends AbstractHttpClient {
64
64
  async resolveUrl(url) {
65
65
  return this.apiServerUrl + url;
66
66
  }
67
+ async getAuthorizationHeader() {
68
+ return {};
69
+ }
70
+ errorHandler(_operation, err) {
71
+ throw err;
72
+ }
67
73
  async retry(apiCall, retryCount = 0) {
68
74
  try {
69
75
  return await apiCall();
@@ -146,4 +152,7 @@ export class DefaultHttpClient extends AbstractHttpClient {
146
152
  options,
147
153
  });
148
154
  }
155
+ clone(apiServerUrl) {
156
+ return new DefaultHttpClient(apiServerUrl, this.logger, this.maxRetryCount, this.delayMsBetweenRetry, this.storage);
157
+ }
149
158
  }
@@ -14,7 +14,7 @@ export declare abstract class RefreshHttpClient extends DefaultHttpClient {
14
14
  private tokenQueue;
15
15
  constructor(apiServerUrl: string, tokenManager: AbstractTokenManager, logger?: LogHandler | undefined, maxRetryCount?: number, delayMsBetweenRetry?: number, storage?: AbstractStorage | undefined);
16
16
  protected getAuthorization(): Promise<string>;
17
- protected abstract refreshSession(token?: AccessToken): Promise<AccessToken | undefined>;
17
+ protected abstract getNewAccessToken(token?: AccessToken): Promise<AccessToken | undefined>;
18
18
  protected errorHandler<T = any>(operation: () => Promise<T>, err: any): Promise<T | undefined>;
19
19
  protected getAuthorizationHeader(): Promise<Record<string, string>>;
20
20
  protected refreshToken(token?: AccessToken): Promise<void>;
@@ -50,7 +50,7 @@ export class RefreshHttpClient extends DefaultHttpClient {
50
50
  token = token || (await this.tokenManager.getAccessToken());
51
51
  try {
52
52
  this.refreshing = true;
53
- token = await this.refreshSession(token).catch(() => undefined);
53
+ token = await this.getNewAccessToken(token).catch(() => undefined);
54
54
  if (!token) {
55
55
  throw Errors.SESSION_EXPIRED();
56
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clairejs/client",
3
- "version": "3.5.6",
3
+ "version": "3.5.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -13,7 +13,7 @@
13
13
  "axios": "^1.3.4"
14
14
  },
15
15
  "peerDependencies": {
16
- "@clairejs/core": "^3.9.0"
16
+ "@clairejs/core": "^3.9.4"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/mocha": "^10.0.1",