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