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