@clairejs/client 3.5.6 → 3.5.7

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