@clairejs/client 3.2.33 → 3.3.0
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/.mocharc.json +3 -0
- package/README.md +4 -0
- package/dist/api/AbstractHttpClient.d.ts +0 -1
- package/dist/api/AbstractHttpClient.js +21 -0
- package/dist/api/AbstractTokenManager.d.ts +0 -1
- package/dist/api/AbstractTokenManager.js +2 -0
- package/dist/api/CrudApi.d.ts +1 -2
- package/dist/api/CrudApi.js +109 -0
- package/dist/api/DefaultHttpClient.d.ts +1 -2
- package/dist/api/DefaultHttpClient.js +134 -0
- package/dist/api/DefaultTokenManager.d.ts +0 -1
- package/dist/api/DefaultTokenManager.js +42 -0
- package/dist/api/RefreshHttpClient.d.ts +0 -1
- package/dist/api/RefreshHttpClient.js +99 -0
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +2 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +17 -2
- package/dist/routing/AbstractErrorHandler.d.ts +0 -1
- package/dist/routing/AbstractErrorHandler.js +2 -0
- package/dist/routing/AbstractViewMiddleware.d.ts +0 -1
- package/dist/routing/AbstractViewMiddleware.js +2 -0
- package/dist/routing/ComponentInfo.d.ts +0 -1
- package/dist/routing/ComponentInfo.js +1 -0
- package/dist/routing/RouterConfig.d.ts +0 -1
- package/dist/routing/RouterConfig.js +1 -0
- package/dist/routing/UrlInfo.d.ts +0 -1
- package/dist/routing/UrlInfo.js +1 -0
- package/dist/socket/AbstractClientSocketManager.d.ts +0 -1
- package/dist/socket/AbstractClientSocketManager.js +2 -0
- package/dist/socket/DefaultClientSocket.d.ts +0 -1
- package/dist/socket/DefaultClientSocket.js +27 -0
- package/dist/socket/DefaultClientSocketManager.d.ts +0 -1
- package/dist/socket/DefaultClientSocketManager.js +369 -0
- package/dist/socket/IWebSocket.d.ts +0 -1
- package/dist/socket/IWebSocket.js +1 -0
- package/dist/socket/SocketConfig.d.ts +0 -1
- package/dist/socket/SocketConfig.js +1 -0
- package/dist/system/AbstractStorage.d.ts +0 -1
- package/dist/system/AbstractStorage.js +2 -0
- package/dist/system/ClaireClient.d.ts +0 -1
- package/dist/system/ClaireClient.js +3 -0
- package/dist/translation/Translator.d.ts +3 -6
- package/dist/translation/Translator.js +103 -0
- package/package.json +9 -13
- package/tsconfig-build.json +3 -4
- package/dist/api/AbstractHttpClient.d.ts.map +0 -1
- package/dist/api/AbstractTokenManager.d.ts.map +0 -1
- package/dist/api/CrudApi.d.ts.map +0 -1
- package/dist/api/DefaultHttpClient.d.ts.map +0 -1
- package/dist/api/DefaultTokenManager.d.ts.map +0 -1
- package/dist/api/RefreshHttpClient.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/routing/AbstractErrorHandler.d.ts.map +0 -1
- package/dist/routing/AbstractViewMiddleware.d.ts.map +0 -1
- package/dist/routing/ComponentInfo.d.ts.map +0 -1
- package/dist/routing/RouterConfig.d.ts.map +0 -1
- package/dist/routing/UrlInfo.d.ts.map +0 -1
- package/dist/socket/AbstractClientSocketManager.d.ts.map +0 -1
- package/dist/socket/DefaultClientSocket.d.ts.map +0 -1
- package/dist/socket/DefaultClientSocketManager.d.ts.map +0 -1
- package/dist/socket/IWebSocket.d.ts.map +0 -1
- package/dist/socket/SocketConfig.d.ts.map +0 -1
- package/dist/system/AbstractStorage.d.ts.map +0 -1
- package/dist/system/ClaireClient.d.ts.map +0 -1
- package/dist/translation/Translator.d.ts.map +0 -1
- package/webpack.config.js +0 -46
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class DefaultClientSocket {
|
|
2
|
+
socketManager;
|
|
3
|
+
constructor(socketManager) {
|
|
4
|
+
this.socketManager = socketManager;
|
|
5
|
+
}
|
|
6
|
+
joinChannels(channels) {
|
|
7
|
+
this.socketManager.subChannels(this, channels);
|
|
8
|
+
}
|
|
9
|
+
leaveChannels(channels) {
|
|
10
|
+
this.socketManager.unsubChannels(this, channels);
|
|
11
|
+
}
|
|
12
|
+
close() {
|
|
13
|
+
this.socketManager.removeSocket(this);
|
|
14
|
+
}
|
|
15
|
+
onReconnect(handler) {
|
|
16
|
+
this.socketManager.registerReconnectionHandler(this, handler);
|
|
17
|
+
}
|
|
18
|
+
onDisconnect(handler) {
|
|
19
|
+
this.socketManager.registerDisconnectionHandler(this, handler);
|
|
20
|
+
}
|
|
21
|
+
onMessage(handler) {
|
|
22
|
+
this.socketManager.registerMessageHandler(this, handler);
|
|
23
|
+
}
|
|
24
|
+
send(message, channel) {
|
|
25
|
+
this.socketManager.sendPlainMessageToChannel(message, channel);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { Errors, MessageType, } from "@clairejs/core";
|
|
2
|
+
import { AbstractClientSocketManager } from "./AbstractClientSocketManager";
|
|
3
|
+
import { DefaultClientSocket } from "./DefaultClientSocket";
|
|
4
|
+
const pingpongMaxCount = 10;
|
|
5
|
+
export class DefaultClientSocketManager extends AbstractClientSocketManager {
|
|
6
|
+
wsProvider;
|
|
7
|
+
logger;
|
|
8
|
+
config;
|
|
9
|
+
socket;
|
|
10
|
+
allSockets = [];
|
|
11
|
+
allChannels = [];
|
|
12
|
+
socketConnected;
|
|
13
|
+
pingIntervalId;
|
|
14
|
+
retryTimeoutId;
|
|
15
|
+
accumulatedPing = 0;
|
|
16
|
+
retryDelay = 0;
|
|
17
|
+
intendedDisconnection;
|
|
18
|
+
pingpongId = 0;
|
|
19
|
+
pingpong = [];
|
|
20
|
+
constructor(wsProvider, logger, config) {
|
|
21
|
+
super();
|
|
22
|
+
this.wsProvider = wsProvider;
|
|
23
|
+
this.logger = logger;
|
|
24
|
+
this.config = config;
|
|
25
|
+
}
|
|
26
|
+
getPingMs() {
|
|
27
|
+
const candidates = this.pingpong.filter((pp) => pp.sentTimestamp && pp.receivedTimestamp);
|
|
28
|
+
if (!candidates.length) {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
return (candidates.map((pp) => pp.receivedTimestamp - pp.sentTimestamp).reduce((total, diff) => total + diff, 0) /
|
|
32
|
+
candidates.length);
|
|
33
|
+
}
|
|
34
|
+
subChannels(socket, channels) {
|
|
35
|
+
const info = this.allSockets.find((s) => s.socket === socket);
|
|
36
|
+
if (!info) {
|
|
37
|
+
this.logger.debug("Socket not found");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
//-- un-connected channels
|
|
41
|
+
const unconnectedChannels = [];
|
|
42
|
+
for (const channel of channels) {
|
|
43
|
+
if (!info.registeredChannels.includes(channel)) {
|
|
44
|
+
info.registeredChannels.push(channel);
|
|
45
|
+
}
|
|
46
|
+
const foundChannel = this.allChannels.find((c) => c.channel === channel);
|
|
47
|
+
if (!foundChannel || !foundChannel.connected) {
|
|
48
|
+
unconnectedChannels.push(channel);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
this.joinChannels(unconnectedChannels);
|
|
52
|
+
}
|
|
53
|
+
unsubChannels(socket, channels) {
|
|
54
|
+
const info = this.allSockets.find((s) => s.socket === socket);
|
|
55
|
+
if (!info) {
|
|
56
|
+
this.logger.debug("Socket not found");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
info.registeredChannels = info.registeredChannels.filter((c) => !channels.includes(c));
|
|
60
|
+
//-- check if no one is subscribing these channel then remove
|
|
61
|
+
const removedChannels = [];
|
|
62
|
+
for (const channel of channels) {
|
|
63
|
+
//-- no one is listening
|
|
64
|
+
if (!this.allSockets.find((socket) => socket.registeredChannels.includes(channel))) {
|
|
65
|
+
removedChannels.push(channel);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
this.leaveChannels(removedChannels);
|
|
69
|
+
}
|
|
70
|
+
removeSocket(socket) {
|
|
71
|
+
const socketInfo = this.allSockets.find((s) => s.socket === socket);
|
|
72
|
+
if (socketInfo && socketInfo.disconnectionHandler) {
|
|
73
|
+
socketInfo.disconnectionHandler();
|
|
74
|
+
}
|
|
75
|
+
this.allSockets = this.allSockets.filter((s) => s.socket !== socket);
|
|
76
|
+
if (!this.allSockets.length) {
|
|
77
|
+
this.forceDisconnect();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
registerReconnectionHandler(socket, handler) {
|
|
81
|
+
const info = this.allSockets.find((s) => s.socket === socket);
|
|
82
|
+
if (info) {
|
|
83
|
+
info.reconnectionHandler = handler;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
registerDisconnectionHandler(socket, handler) {
|
|
87
|
+
const info = this.allSockets.find((s) => s.socket === socket);
|
|
88
|
+
if (info) {
|
|
89
|
+
info.disconnectionHandler = handler;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
registerMessageHandler(socket, handler) {
|
|
93
|
+
const info = this.allSockets.find((s) => s.socket === socket);
|
|
94
|
+
if (info) {
|
|
95
|
+
info.messageHandler = handler;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
sendPlainMessageToChannel(message, channel) {
|
|
99
|
+
if (channel) {
|
|
100
|
+
//-- check if channel has been connected
|
|
101
|
+
let foundChannel = this.allChannels.find((c) => c.channel === channel);
|
|
102
|
+
if (!foundChannel) {
|
|
103
|
+
foundChannel = { channel, connected: false, pendingMessages: [] };
|
|
104
|
+
this.allChannels.push(foundChannel);
|
|
105
|
+
}
|
|
106
|
+
if (foundChannel.connected) {
|
|
107
|
+
//-- send
|
|
108
|
+
this.sendRawMessage({
|
|
109
|
+
type: MessageType.PLAIN,
|
|
110
|
+
data: { channel, message },
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
foundChannel.pendingMessages.push(message);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.sendRawMessage({
|
|
119
|
+
type: MessageType.PLAIN,
|
|
120
|
+
data: {
|
|
121
|
+
message,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
joinChannels(channels) {
|
|
127
|
+
if (!channels.length) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (!this.socket || !this.socketConnected) {
|
|
131
|
+
//-- create pending channels
|
|
132
|
+
for (const channel of channels) {
|
|
133
|
+
let foundChannel = this.allChannels.find((c) => c.channel === channel);
|
|
134
|
+
if (!foundChannel) {
|
|
135
|
+
foundChannel = { channel, connected: false, pendingMessages: [] };
|
|
136
|
+
this.allChannels.push(foundChannel);
|
|
137
|
+
}
|
|
138
|
+
///-- this channel is already connected, skip
|
|
139
|
+
if (foundChannel.connected) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
this.sendRawMessage({
|
|
146
|
+
type: MessageType.CHANNEL_JOIN,
|
|
147
|
+
data: channels,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
leaveChannels(channels) {
|
|
152
|
+
if (!channels.length) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this.handleChannelLeave(channels);
|
|
156
|
+
if (this.socket && this.socketConnected) {
|
|
157
|
+
this.sendRawMessage({
|
|
158
|
+
type: MessageType.CHANNEL_LEAVE,
|
|
159
|
+
data: channels,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
sendPingPong() {
|
|
164
|
+
this.pingpongId += 1;
|
|
165
|
+
this.pingpongId %= 100;
|
|
166
|
+
const pingpongInfo = { id: this.pingpongId, sentTimestamp: Date.now() };
|
|
167
|
+
this.pingpong.push(pingpongInfo);
|
|
168
|
+
if (this.pingpong.length > pingpongMaxCount) {
|
|
169
|
+
this.pingpong.shift();
|
|
170
|
+
}
|
|
171
|
+
this.sendRawMessage({
|
|
172
|
+
type: MessageType.PING_PONG,
|
|
173
|
+
data: pingpongInfo.id,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
sendRawMessage(message) {
|
|
177
|
+
if (!this.socket || !this.socketConnected) {
|
|
178
|
+
throw Errors.SYSTEM_ERROR("Socket not available");
|
|
179
|
+
}
|
|
180
|
+
this.socket.send(message);
|
|
181
|
+
this.logger.debug("Raw send", message);
|
|
182
|
+
}
|
|
183
|
+
handleChannelJoin(channels) {
|
|
184
|
+
this.logger.debug("Joinning channels", channels);
|
|
185
|
+
for (const channel of channels) {
|
|
186
|
+
let foundChannel = this.allChannels.find((c) => c.channel === channel);
|
|
187
|
+
if (!foundChannel) {
|
|
188
|
+
foundChannel = { channel, connected: false, pendingMessages: [] };
|
|
189
|
+
this.allChannels.push(foundChannel);
|
|
190
|
+
}
|
|
191
|
+
foundChannel.connected = true;
|
|
192
|
+
//-- flush messages
|
|
193
|
+
if (foundChannel.pendingMessages.length) {
|
|
194
|
+
this.logger.debug(`Flushing ${foundChannel.pendingMessages.length} message`);
|
|
195
|
+
for (const message of foundChannel.pendingMessages) {
|
|
196
|
+
this.sendPlainMessageToChannel(message, foundChannel.channel);
|
|
197
|
+
}
|
|
198
|
+
foundChannel.pendingMessages = [];
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
handleChannelLeave(channels) {
|
|
203
|
+
this.logger.debug("Leaving channels", channels);
|
|
204
|
+
this.allChannels = this.allChannels.filter((c) => !channels.includes(c.channel));
|
|
205
|
+
}
|
|
206
|
+
handlePlainMessage(message, channel) {
|
|
207
|
+
for (const socket of this.allSockets) {
|
|
208
|
+
socket.messageHandler && socket.messageHandler(message, channel);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
handleConnect() {
|
|
212
|
+
this.logger.debug("Socket connected");
|
|
213
|
+
//-- socket open, set interval
|
|
214
|
+
if (this.pingIntervalId) {
|
|
215
|
+
clearInterval(this.pingIntervalId);
|
|
216
|
+
}
|
|
217
|
+
this.accumulatedPing = 0;
|
|
218
|
+
this.pingIntervalId = setInterval(() => {
|
|
219
|
+
this.accumulatedPing += 1;
|
|
220
|
+
if (this.accumulatedPing > (this.config?.keepAlive?.deadThreshold || 3)) {
|
|
221
|
+
//-- socket connection lost, not intended
|
|
222
|
+
this.intendedDisconnection = false;
|
|
223
|
+
this.socket?.close();
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
this.sendPingPong();
|
|
227
|
+
}
|
|
228
|
+
}, this.config?.keepAlive?.pingIntervalMs || 10000);
|
|
229
|
+
this.intendedDisconnection = false;
|
|
230
|
+
if (this.retryTimeoutId) {
|
|
231
|
+
clearTimeout(this.retryTimeoutId);
|
|
232
|
+
this.retryTimeoutId = undefined;
|
|
233
|
+
}
|
|
234
|
+
for (const socket of this.allSockets) {
|
|
235
|
+
socket.reconnectionHandler && socket.reconnectionHandler();
|
|
236
|
+
}
|
|
237
|
+
//-- try join pending channels
|
|
238
|
+
const pendingChannels = this.allChannels.filter((c) => !c.connected).map((c) => c.channel);
|
|
239
|
+
this.joinChannels(pendingChannels);
|
|
240
|
+
}
|
|
241
|
+
handleDisconnect(err) {
|
|
242
|
+
if (err) {
|
|
243
|
+
this.intendedDisconnection = true;
|
|
244
|
+
}
|
|
245
|
+
this.logger.debug("Socket connnection closed, error: ", err);
|
|
246
|
+
if (this.pingIntervalId) {
|
|
247
|
+
clearInterval(this.pingIntervalId);
|
|
248
|
+
}
|
|
249
|
+
this.socket = undefined;
|
|
250
|
+
this.socketConnected = false;
|
|
251
|
+
for (const socket of this.allSockets) {
|
|
252
|
+
socket.disconnectionHandler && socket.disconnectionHandler(err);
|
|
253
|
+
}
|
|
254
|
+
if (this.intendedDisconnection) {
|
|
255
|
+
//-- remove all channels
|
|
256
|
+
this.allSockets = [];
|
|
257
|
+
this.allChannels = [];
|
|
258
|
+
this.logger.debug("Socket connection terminated");
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
//-- disconnect all channels to be reconnected when the socket is connected again
|
|
262
|
+
this.allChannels = this.allChannels.map((c) => ({ ...c, connected: false }));
|
|
263
|
+
if (!this.retryTimeoutId) {
|
|
264
|
+
this.retryDelay = 0;
|
|
265
|
+
this.retry();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
handleMessage(message) {
|
|
270
|
+
this.logger.debug("Raw receive", message);
|
|
271
|
+
switch (message.type) {
|
|
272
|
+
case MessageType.READY:
|
|
273
|
+
this.handleConnect();
|
|
274
|
+
break;
|
|
275
|
+
case MessageType.PING_PONG:
|
|
276
|
+
this.accumulatedPing = 0;
|
|
277
|
+
const id = message.data;
|
|
278
|
+
if (id) {
|
|
279
|
+
const pong = this.pingpong.find((pp) => pp.id === id);
|
|
280
|
+
if (pong) {
|
|
281
|
+
pong.receivedTimestamp = Date.now();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
case MessageType.CHANNEL_JOIN:
|
|
286
|
+
if (message.data?.error) {
|
|
287
|
+
this.logger.error("Join channel error", message.data.error);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
this.handleChannelJoin(message.data);
|
|
291
|
+
}
|
|
292
|
+
break;
|
|
293
|
+
case MessageType.CHANNEL_LEAVE:
|
|
294
|
+
this.handleChannelLeave(message.data);
|
|
295
|
+
break;
|
|
296
|
+
case MessageType.PLAIN:
|
|
297
|
+
this.handlePlainMessage(message.data.message, message.data.channel);
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
create() {
|
|
302
|
+
const socket = new DefaultClientSocket(this);
|
|
303
|
+
this.allSockets.push({ socket, registeredChannels: [] });
|
|
304
|
+
if (this.allSockets.length === 1) {
|
|
305
|
+
this.forceReconnect();
|
|
306
|
+
}
|
|
307
|
+
return socket;
|
|
308
|
+
}
|
|
309
|
+
forceDisconnect() {
|
|
310
|
+
this.intendedDisconnection = true;
|
|
311
|
+
if (this.socket) {
|
|
312
|
+
this.socket.close();
|
|
313
|
+
this.socket = undefined;
|
|
314
|
+
}
|
|
315
|
+
if (this.retryTimeoutId) {
|
|
316
|
+
clearTimeout(this.retryTimeoutId);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
forceReconnect() {
|
|
320
|
+
this.intendedDisconnection = false;
|
|
321
|
+
if (this.socketConnected) {
|
|
322
|
+
this.socket?.close();
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
this.retryDelay = 0;
|
|
326
|
+
if (this.socket === undefined) {
|
|
327
|
+
if (this.retryTimeoutId) {
|
|
328
|
+
clearTimeout(this.retryTimeoutId);
|
|
329
|
+
this.retryTimeoutId = undefined;
|
|
330
|
+
}
|
|
331
|
+
this.physicConnect();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
physicConnect() {
|
|
336
|
+
this.wsProvider().then((socket) => {
|
|
337
|
+
this.socket = socket;
|
|
338
|
+
this.socket.onopen(() => {
|
|
339
|
+
this.socketConnected = true;
|
|
340
|
+
this.logger.debug("Physic link connected, sending & waiting for READY message");
|
|
341
|
+
this.sendRawMessage({
|
|
342
|
+
type: MessageType.READY,
|
|
343
|
+
data: "",
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
this.socket.onmessage((data) => {
|
|
347
|
+
const message = JSON.parse(data);
|
|
348
|
+
if (!message || !message.type) {
|
|
349
|
+
this.logger.debug("Invalid mesasge structure", data);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
this.handleMessage(message);
|
|
353
|
+
});
|
|
354
|
+
this.socket.onclose((err) => {
|
|
355
|
+
this.handleDisconnect(err);
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
retry() {
|
|
360
|
+
this.logger.debug(`Socket connection retrying in ${this.retryDelay}ms`);
|
|
361
|
+
this.physicConnect();
|
|
362
|
+
this.retryDelay += this.config?.reconnectTimeDeltaMs || 3000;
|
|
363
|
+
this.retryTimeoutId = setTimeout(() => {
|
|
364
|
+
if (!this.socketConnected && !this.intendedDisconnection) {
|
|
365
|
+
this.retry();
|
|
366
|
+
}
|
|
367
|
+
}, this.retryDelay);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { AbstractLogger } from "@clairejs/core";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}>;
|
|
6
|
-
export declare type TranslationData = Record<string, string>;
|
|
2
|
+
export type TranslationObject = Record<string, string>;
|
|
3
|
+
export type TranslationProvider = Promise<TranslationObject>;
|
|
4
|
+
export type TranslationData = Record<string, string>;
|
|
7
5
|
export declare class Translator {
|
|
8
6
|
readonly logger: AbstractLogger;
|
|
9
7
|
private translationProviders?;
|
|
@@ -15,4 +13,3 @@ export declare class Translator {
|
|
|
15
13
|
translate(lang: string, template: string, data?: TranslationData): string;
|
|
16
14
|
protected translateText(template: string, data?: TranslationData): string;
|
|
17
15
|
}
|
|
18
|
-
//# sourceMappingURL=Translator.d.ts.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { AbstractLogger, Injectable } from "@clairejs/core";
|
|
11
|
+
const dataKeyRegex = /{([_a-zA-Z][a-zA-Z0-9_]*)}/g;
|
|
12
|
+
let Translator = class Translator {
|
|
13
|
+
logger;
|
|
14
|
+
translationProviders;
|
|
15
|
+
translations = {};
|
|
16
|
+
translationLoadings = {};
|
|
17
|
+
constructor(logger) {
|
|
18
|
+
this.logger = logger;
|
|
19
|
+
}
|
|
20
|
+
setTranslations(translationProviders) {
|
|
21
|
+
const langKeys = Object.keys(translationProviders);
|
|
22
|
+
this.translationProviders = translationProviders;
|
|
23
|
+
for (const lang of langKeys) {
|
|
24
|
+
this.translations[lang] = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async awaitingTranslations(lang) {
|
|
28
|
+
if (this.translations[lang] === null) {
|
|
29
|
+
if (!this.translationLoadings[lang]) {
|
|
30
|
+
//-- first request to load translation
|
|
31
|
+
this.translationLoadings[lang] = [];
|
|
32
|
+
if (!this.translationProviders || !this.translationProviders[lang]) {
|
|
33
|
+
this.translations[lang] = undefined;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
//-- get the translation
|
|
37
|
+
try {
|
|
38
|
+
const trans = await this.translationProviders[lang];
|
|
39
|
+
this.translations[lang] = trans;
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
//-- error loading translation
|
|
43
|
+
this.logger.error("Error loading translation", err);
|
|
44
|
+
this.translations[lang] = undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//-- resolve all pending promises
|
|
48
|
+
for (const resolver of this.translationLoadings[lang] || []) {
|
|
49
|
+
resolver();
|
|
50
|
+
}
|
|
51
|
+
this.translationLoadings[lang] = [];
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
let resolver = () => { };
|
|
55
|
+
const promise = new Promise((resolve) => (resolver = resolve));
|
|
56
|
+
this.translationLoadings[lang].push(resolver);
|
|
57
|
+
return promise;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return Promise.resolve();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
translate(lang, template, data) {
|
|
65
|
+
//-- if provider not found for current lang then use default language
|
|
66
|
+
if (!this.translationProviders || !this.translationProviders[lang]) {
|
|
67
|
+
return this.translateText(template, data);
|
|
68
|
+
}
|
|
69
|
+
const translation = this.translations[lang];
|
|
70
|
+
if (!translation || !translation[template]) {
|
|
71
|
+
return this.translateText(template, data);
|
|
72
|
+
}
|
|
73
|
+
return this.translateText(translation[template], data);
|
|
74
|
+
}
|
|
75
|
+
translateText(template, data) {
|
|
76
|
+
let result = "";
|
|
77
|
+
if (template) {
|
|
78
|
+
const matchAll = template.matchAll(dataKeyRegex);
|
|
79
|
+
let lastIndex = 0;
|
|
80
|
+
for (const match of matchAll) {
|
|
81
|
+
//-- remove brackets
|
|
82
|
+
const key = match[1];
|
|
83
|
+
result += template.slice(lastIndex, match.index);
|
|
84
|
+
if (data && typeof data[key] === "string") {
|
|
85
|
+
result += data[key];
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
result += match[0];
|
|
89
|
+
}
|
|
90
|
+
lastIndex = (match.index || 0) + match[0].length;
|
|
91
|
+
}
|
|
92
|
+
if (lastIndex < template.length) {
|
|
93
|
+
result += template.slice(lastIndex);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
Translator = __decorate([
|
|
100
|
+
Injectable(),
|
|
101
|
+
__metadata("design:paramtypes", [AbstractLogger])
|
|
102
|
+
], Translator);
|
|
103
|
+
export { Translator };
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clairejs/client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
|
-
"test": "mocha
|
|
8
|
-
"build": "rm -rf ./dist &&
|
|
8
|
+
"test": "mocha ./test/*.test.ts",
|
|
9
|
+
"build": "rm -rf ./dist && tsc -p tsconfig-build.json",
|
|
9
10
|
"push": "npm run build && npm run test && npm publish && git push"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
@@ -15,15 +16,10 @@
|
|
|
15
16
|
"@clairejs/core": "^3.4.2"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
|
-
"@types/mocha": "^
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"ts-
|
|
22
|
-
"
|
|
23
|
-
"tslib": "^2.1.0",
|
|
24
|
-
"typescript": "^4.4.4",
|
|
25
|
-
"webpack": "^5.73.0",
|
|
26
|
-
"webpack-cli": "^4.10.0",
|
|
27
|
-
"webpack-node-externals": "^2.5.2"
|
|
19
|
+
"@types/mocha": "^10.0.1",
|
|
20
|
+
"@types/node": "^18.16.1",
|
|
21
|
+
"mocha": "^10.2.0",
|
|
22
|
+
"ts-node": "^10.9.1",
|
|
23
|
+
"typescript": "^5.0.4"
|
|
28
24
|
}
|
|
29
25
|
}
|
package/tsconfig-build.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "./tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
// "noUnusedLocals": true,
|
|
4
|
+
"outDir": "./dist",
|
|
5
|
+
"noUnusedLocals": true,
|
|
6
|
+
"noUnusedParameters": true
|
|
8
7
|
},
|
|
9
8
|
"exclude": ["./test/", "./node_modules/"]
|
|
10
9
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractHttpClient.d.ts","sourceRoot":"","sources":["../../src/api/AbstractHttpClient.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CA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ourceRoot":"","sources":["../../src/api/AbstractTokenManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,8BAAsB,oBAAoB;IACtC,QAAQ,CAAC,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrudApi.d.ts","sourceRoot":"","sources":["../../src/api/CrudApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EAEtB,WAAW,EACX,cAAc,EACd,mBAAmB,EAGnB,YAAY,EAEZ,gBAAgB,EAEhB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAO,MAAM,gBAAgB,YAAa,OAAO,MAAM,EAAE,GAAG,CAAC,WAO5D,CAAC;AAEF,eAAO,MAAM,eAAe,4EAS3B,CAAC;AAEF,eAAO,MAAM,cAAc,gLA4E1B,CAAC;AAEF,qBAAa,OAAO,CAAC,CAAC,SAAS,aAAa;IAG5B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAAE,QAAQ,CAAC,UAAU,EAAE,kBAAkB;IAFnF,OAAO,CAAC,KAAK,CAAQ;gBAEA,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAW,UAAU,EAAE,kBAAkB;IAEnF,SAAS,CAAC,kBAAkB;IAItB,OAAO,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAcl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AUnB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EACtB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,EACP,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAUnB,MAAM,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CAQzG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultTokenManager.d.ts","sourceRoot":"","sources":["../../src/api/DefaultTokenManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBACa,mBAAoB,SAAQ,oBAAoB;IAG7C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe;IAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAF9F,OAAO,CAAC,WAAW,CAAC,CAAsB;gBAEX,OAAO,EAAE,eAAe,EAAqB,UAAU,GAAE,MAAuB;IAIzG,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAOlD,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ3D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshHttpClient.d.ts","sourceRoot":"","sources":["../../src/api/RefreshHttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAU,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAE,eAAe,EA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package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC"}
|