@wazo/sdk 0.39.0-beta.8 → 0.39.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/README.md +7 -7
- package/dist/wazo-sdk.js +12 -12
- package/esm/__tests__/api-client.test.js +7 -1
- package/esm/__tests__/web-rtc-client.test.js +10 -0
- package/esm/api/chatd.js +17 -3
- package/esm/api/dird.js +2 -2
- package/esm/api-client.js +4 -0
- package/esm/checker/checks/ice-ipv4.js +2 -1
- package/esm/domain/Contact.js +15 -8
- package/esm/domain/Phone/WebRTCPhone.js +9 -11
- package/esm/domain/Session.js +24 -0
- package/esm/domain/__tests__/Contact.test.js +200 -48
- package/esm/lib/WazoSessionDescriptionHandler.js +14 -11
- package/esm/service/IssueReporter.js +12 -2
- package/esm/service/__tests__/IssueReporter.test.js +12 -0
- package/esm/service/getApiClient.js +9 -0
- package/esm/simple/Auth.js +40 -5
- package/esm/simple/Phone.js +3 -1
- package/esm/simple/Websocket.js +1 -0
- package/esm/simple/room/Stream.js +3 -3
- package/esm/types/api/chatd.d.ts +1 -1
- package/esm/types/api/chatd.d.ts.map +1 -1
- package/esm/types/api/dird.d.ts.map +1 -1
- package/esm/types/api-client.d.ts +3 -2
- package/esm/types/api-client.d.ts.map +1 -1
- package/esm/types/checker/checks/ice-ipv4.d.ts.map +1 -1
- package/esm/types/domain/Contact.d.ts +1 -1
- package/esm/types/domain/Contact.d.ts.map +1 -1
- package/esm/types/domain/Phone/WebRTCPhone.d.ts +1 -1
- package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/esm/types/domain/Session.d.ts +2 -0
- package/esm/types/domain/Session.d.ts.map +1 -1
- package/esm/types/domain/types.d.ts +40 -14
- package/esm/types/domain/types.d.ts.map +1 -1
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.d.ts.map +1 -1
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts +1 -1
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -1
- package/esm/types/service/IssueReporter.d.ts +1 -0
- package/esm/types/service/IssueReporter.d.ts.map +1 -1
- package/esm/types/service/getApiClient.d.ts +2 -0
- package/esm/types/service/getApiClient.d.ts.map +1 -1
- package/esm/types/simple/Auth.d.ts.map +1 -1
- package/esm/types/simple/Phone.d.ts +4 -3
- package/esm/types/simple/Phone.d.ts.map +1 -1
- package/esm/types/simple/Websocket.d.ts.map +1 -1
- package/esm/types/simple/index.d.ts +1 -0
- package/esm/types/simple/index.d.ts.map +1 -1
- package/esm/types/utils/Emitter.d.ts +1 -1
- package/esm/types/utils/Heartbeat.d.ts +3 -2
- package/esm/types/utils/Heartbeat.d.ts.map +1 -1
- package/esm/types/utils/api-requester.d.ts +5 -1
- package/esm/types/utils/api-requester.d.ts.map +1 -1
- package/esm/types/web-rtc-client.d.ts +5 -29
- package/esm/types/web-rtc-client.d.ts.map +1 -1
- package/esm/types/websocket-client.d.ts +5 -1
- package/esm/types/websocket-client.d.ts.map +1 -1
- package/esm/utils/__tests__/api-requester.test.js +7 -2
- package/esm/utils/api-requester.js +23 -5
- package/esm/web-rtc-client.js +69 -40
- package/esm/websocket-client.js +9 -2
- package/lib/__tests__/api-client.test.js +7 -1
- package/lib/__tests__/web-rtc-client.test.js +16 -0
- package/lib/api/chatd.js +23 -7
- package/lib/api/dird.js +2 -2
- package/lib/api-client.js +4 -0
- package/lib/checker/checks/ice-ipv4.js +2 -1
- package/lib/domain/Contact.js +15 -8
- package/lib/domain/Phone/WebRTCPhone.js +9 -11
- package/lib/domain/Session.js +23 -0
- package/lib/domain/__tests__/Contact.test.js +175 -50
- package/lib/lib/WazoSessionDescriptionHandler.js +15 -12
- package/lib/service/IssueReporter.js +12 -2
- package/lib/service/__tests__/IssueReporter.test.js +12 -0
- package/lib/service/getApiClient.js +12 -1
- package/lib/simple/Auth.js +34 -4
- package/lib/simple/Phone.js +3 -1
- package/lib/simple/Websocket.js +1 -0
- package/lib/simple/room/Stream.js +3 -3
- package/lib/types/api/chatd.d.ts +1 -1
- package/lib/types/api/chatd.d.ts.map +1 -1
- package/lib/types/api/dird.d.ts.map +1 -1
- package/lib/types/api-client.d.ts +3 -2
- package/lib/types/api-client.d.ts.map +1 -1
- package/lib/types/checker/checks/ice-ipv4.d.ts.map +1 -1
- package/lib/types/domain/Contact.d.ts +1 -1
- package/lib/types/domain/Contact.d.ts.map +1 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts +1 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/lib/types/domain/Session.d.ts +2 -0
- package/lib/types/domain/Session.d.ts.map +1 -1
- package/lib/types/domain/types.d.ts +40 -14
- package/lib/types/domain/types.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts +1 -1
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -1
- package/lib/types/service/IssueReporter.d.ts +1 -0
- package/lib/types/service/IssueReporter.d.ts.map +1 -1
- package/lib/types/service/getApiClient.d.ts +2 -0
- package/lib/types/service/getApiClient.d.ts.map +1 -1
- package/lib/types/simple/Auth.d.ts.map +1 -1
- package/lib/types/simple/Phone.d.ts +4 -3
- package/lib/types/simple/Phone.d.ts.map +1 -1
- package/lib/types/simple/Websocket.d.ts.map +1 -1
- package/lib/types/simple/index.d.ts +1 -0
- package/lib/types/simple/index.d.ts.map +1 -1
- package/lib/types/utils/Emitter.d.ts +1 -1
- package/lib/types/utils/Heartbeat.d.ts +3 -2
- package/lib/types/utils/Heartbeat.d.ts.map +1 -1
- package/lib/types/utils/api-requester.d.ts +5 -1
- package/lib/types/utils/api-requester.d.ts.map +1 -1
- package/lib/types/web-rtc-client.d.ts +5 -29
- package/lib/types/web-rtc-client.d.ts.map +1 -1
- package/lib/types/websocket-client.d.ts +5 -1
- package/lib/types/websocket-client.d.ts.map +1 -1
- package/lib/utils/__tests__/api-requester.test.js +7 -2
- package/lib/utils/api-requester.js +19 -5
- package/lib/web-rtc-client.js +67 -39
- package/lib/websocket-client.js +8 -2
- package/package.json +37 -35
- package/src/__tests__/api-client.test.ts +9 -1
- package/src/__tests__/web-rtc-client.test.ts +12 -0
- package/src/api/chatd.ts +22 -4
- package/src/api/dird.ts +3 -2
- package/src/api-client.ts +8 -2
- package/src/checker/checks/ice-ipv4.ts +2 -1
- package/src/domain/Contact.ts +16 -8
- package/src/domain/Phone/WebRTCPhone.ts +11 -12
- package/src/domain/Session.ts +28 -0
- package/src/domain/__tests__/Contact.test.ts +213 -54
- package/src/domain/types.ts +42 -14
- package/src/lib/WazoSessionDescriptionHandler.ts +15 -11
- package/src/service/IssueReporter.ts +13 -2
- package/src/service/__tests__/IssueReporter.test.ts +14 -0
- package/src/service/getApiClient.ts +12 -0
- package/src/simple/Auth.ts +58 -6
- package/src/simple/Phone.ts +15 -6
- package/src/simple/Websocket.ts +1 -0
- package/src/simple/room/Stream.ts +3 -3
- package/src/types/global.d.ts +1 -0
- package/src/utils/Heartbeat.ts +2 -2
- package/src/utils/__tests__/api-requester.test.ts +8 -2
- package/src/utils/api-requester.ts +31 -4
- package/src/web-rtc-client.ts +84 -70
- package/src/websocket-client.ts +14 -1
|
@@ -4,6 +4,134 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Contact_1 = __importDefault(require("../Contact"));
|
|
7
|
+
const genericContactResponse = {
|
|
8
|
+
column_types: [
|
|
9
|
+
'name',
|
|
10
|
+
'number',
|
|
11
|
+
'callable',
|
|
12
|
+
'voicemail',
|
|
13
|
+
'favorite',
|
|
14
|
+
'email',
|
|
15
|
+
'personal',
|
|
16
|
+
],
|
|
17
|
+
term: 'a',
|
|
18
|
+
column_headers: [
|
|
19
|
+
'Nom',
|
|
20
|
+
'Num\u00e9ro',
|
|
21
|
+
'Mobile',
|
|
22
|
+
'Bo\u00eete vocale',
|
|
23
|
+
'Favoris',
|
|
24
|
+
'E-mail',
|
|
25
|
+
'Personnel',
|
|
26
|
+
],
|
|
27
|
+
results: [],
|
|
28
|
+
};
|
|
29
|
+
const contact1 = {
|
|
30
|
+
source: 'internal',
|
|
31
|
+
column_values: [
|
|
32
|
+
'Jonathan Lessard',
|
|
33
|
+
'8020',
|
|
34
|
+
'06800880',
|
|
35
|
+
null,
|
|
36
|
+
false,
|
|
37
|
+
'jonathan@example.com',
|
|
38
|
+
false,
|
|
39
|
+
],
|
|
40
|
+
backend: 'wazo',
|
|
41
|
+
relations: {
|
|
42
|
+
user_id: 8,
|
|
43
|
+
xivo_id: '6cd695d2-cdb9-4444-8b2d-27425ab85fa8',
|
|
44
|
+
agent_id: null,
|
|
45
|
+
endpoint_id: 8,
|
|
46
|
+
user_uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
47
|
+
source_entry_id: '8',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
const contact2 = {
|
|
51
|
+
source: 'internal',
|
|
52
|
+
column_values: [
|
|
53
|
+
'John Doe',
|
|
54
|
+
'8021',
|
|
55
|
+
'06800881',
|
|
56
|
+
null,
|
|
57
|
+
false,
|
|
58
|
+
'john@example.com',
|
|
59
|
+
false,
|
|
60
|
+
],
|
|
61
|
+
backend: 'wazo',
|
|
62
|
+
relations: {
|
|
63
|
+
user_id: 9,
|
|
64
|
+
xivo_id: '6cd695d2-cdb9-4444-8b2d-27425ab85fa9',
|
|
65
|
+
agent_id: null,
|
|
66
|
+
endpoint_id: 9,
|
|
67
|
+
user_uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b55',
|
|
68
|
+
source_entry_id: '9',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
const parsedContact1 = new Contact_1.default({
|
|
72
|
+
name: 'Jonathan Lessard',
|
|
73
|
+
number: '8020',
|
|
74
|
+
numbers: [
|
|
75
|
+
{
|
|
76
|
+
label: 'primary',
|
|
77
|
+
number: '8020',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'secondary',
|
|
81
|
+
number: '06800880',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
favorited: false,
|
|
85
|
+
email: 'jonathan@example.com',
|
|
86
|
+
emails: [
|
|
87
|
+
{
|
|
88
|
+
label: 'primary',
|
|
89
|
+
email: 'jonathan@example.com',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
address: '',
|
|
93
|
+
entreprise: '',
|
|
94
|
+
birthday: '',
|
|
95
|
+
note: '',
|
|
96
|
+
endpointId: 8,
|
|
97
|
+
personal: false,
|
|
98
|
+
source: 'internal',
|
|
99
|
+
sourceId: '8',
|
|
100
|
+
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
101
|
+
backend: 'wazo',
|
|
102
|
+
});
|
|
103
|
+
const parsedContact2 = new Contact_1.default({
|
|
104
|
+
name: 'John Doe',
|
|
105
|
+
number: '8021',
|
|
106
|
+
numbers: [
|
|
107
|
+
{
|
|
108
|
+
label: 'primary',
|
|
109
|
+
number: '8021',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: 'secondary',
|
|
113
|
+
number: '06800881',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
favorited: false,
|
|
117
|
+
email: 'john@example.com',
|
|
118
|
+
emails: [
|
|
119
|
+
{
|
|
120
|
+
label: 'primary',
|
|
121
|
+
email: 'john@example.com',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
address: '',
|
|
125
|
+
entreprise: '',
|
|
126
|
+
birthday: '',
|
|
127
|
+
note: '',
|
|
128
|
+
endpointId: 9,
|
|
129
|
+
personal: false,
|
|
130
|
+
source: 'internal',
|
|
131
|
+
sourceId: '9',
|
|
132
|
+
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b55',
|
|
133
|
+
backend: 'wazo',
|
|
134
|
+
});
|
|
7
135
|
describe('Contact domain', () => {
|
|
8
136
|
it('is extern when given no uuid', () => {
|
|
9
137
|
const boba = new Contact_1.default({});
|
|
@@ -136,7 +264,7 @@ describe('Contact domain', () => {
|
|
|
136
264
|
const contact = new Contact_1.default({
|
|
137
265
|
name: 'John Smith',
|
|
138
266
|
});
|
|
139
|
-
const { firstName, lastName
|
|
267
|
+
const { firstName, lastName } = contact.separateName();
|
|
140
268
|
expect(firstName).toBe('John');
|
|
141
269
|
expect(lastName).toBe('Smith');
|
|
142
270
|
});
|
|
@@ -144,7 +272,7 @@ describe('Contact domain', () => {
|
|
|
144
272
|
const contact = new Contact_1.default({
|
|
145
273
|
name: 'John Smith',
|
|
146
274
|
});
|
|
147
|
-
const { firstName, lastName
|
|
275
|
+
const { firstName, lastName } = contact.separateName();
|
|
148
276
|
expect(firstName).toBe('John');
|
|
149
277
|
expect(lastName).toBe('Smith');
|
|
150
278
|
});
|
|
@@ -169,68 +297,65 @@ describe('Contact domain', () => {
|
|
|
169
297
|
expect(contact.isAvailable()).toBeFalsy();
|
|
170
298
|
});
|
|
171
299
|
it('can parse a plain contact to domain', () => {
|
|
172
|
-
const response = {
|
|
173
|
-
column_types: ['name', 'number', 'callable', 'voicemail', 'favorite', 'email', 'personal'],
|
|
174
|
-
term: 'a',
|
|
175
|
-
column_headers: ['Nom', 'Num\u00e9ro', 'Mobile', 'Bo\u00eete vocale', 'Favoris', 'E-mail', 'Personnel'],
|
|
176
|
-
results: [{
|
|
177
|
-
source: 'internal',
|
|
178
|
-
column_values: ['Jonathan Lessard', '8020', '06800880', null, false, 'contact@nexapp.ca', false],
|
|
179
|
-
backend: 'wazo',
|
|
180
|
-
relations: {
|
|
181
|
-
user_id: 8,
|
|
182
|
-
xivo_id: '6cd695d2-cdb9-4444-8b2d-27425ab85fa8',
|
|
183
|
-
agent_id: null,
|
|
184
|
-
endpoint_id: 8,
|
|
185
|
-
user_uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
186
|
-
source_entry_id: '8',
|
|
187
|
-
},
|
|
188
|
-
}],
|
|
189
|
-
};
|
|
300
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1] });
|
|
190
301
|
const contact = Contact_1.default.parse(response.results[0], response.column_types);
|
|
191
|
-
expect(contact).toEqual(
|
|
192
|
-
name: 'Jonathan Lessard',
|
|
193
|
-
number: '8020',
|
|
194
|
-
numbers: [{
|
|
195
|
-
label: 'primary',
|
|
196
|
-
number: '8020',
|
|
197
|
-
}, {
|
|
198
|
-
label: 'secondary',
|
|
199
|
-
number: '06800880',
|
|
200
|
-
}],
|
|
201
|
-
favorited: false,
|
|
202
|
-
email: 'contact@nexapp.ca',
|
|
203
|
-
emails: [{
|
|
204
|
-
label: 'primary',
|
|
205
|
-
email: 'contact@nexapp.ca',
|
|
206
|
-
}],
|
|
207
|
-
address: '',
|
|
208
|
-
entreprise: '',
|
|
209
|
-
birthday: '',
|
|
210
|
-
note: '',
|
|
211
|
-
endpointId: 8,
|
|
212
|
-
personal: false,
|
|
213
|
-
source: 'internal',
|
|
214
|
-
sourceId: '8',
|
|
215
|
-
uuid: 'a14dd6d6-547c-434d-bd5c-e882b5b83b54',
|
|
216
|
-
backend: 'wazo',
|
|
217
|
-
}));
|
|
302
|
+
expect(contact).toEqual(parsedContact1);
|
|
218
303
|
});
|
|
219
304
|
it('should merge 2 contact', () => {
|
|
220
|
-
const
|
|
305
|
+
const noBirthdayContact = new Contact_1.default({
|
|
221
306
|
uuid: 'uuid-12345',
|
|
222
307
|
lastActivity: 'yesterday',
|
|
223
308
|
// @ts-expect-error
|
|
224
309
|
birthday: null,
|
|
225
310
|
});
|
|
226
|
-
const
|
|
311
|
+
const noLastActivityContact = new Contact_1.default({
|
|
227
312
|
uuid: 'uuid-12345',
|
|
228
313
|
// @ts-expect-error
|
|
229
314
|
lastActivity: null,
|
|
230
315
|
birthday: 'tomorrow',
|
|
231
316
|
});
|
|
232
|
-
const result =
|
|
317
|
+
const result = noBirthdayContact.merge(noLastActivityContact);
|
|
233
318
|
expect(result.lastActivity).toBe('yesterday');
|
|
234
319
|
expect(result.birthday).toBe('tomorrow');
|
|
235
320
|
});
|
|
321
|
+
it('returns all contacts when parsing many contacts with no limit', () => {
|
|
322
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
323
|
+
const contacts = Contact_1.default.parseMany(response);
|
|
324
|
+
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
325
|
+
});
|
|
326
|
+
it('returns all contacts when parsing many contacts with a higher limit than number of results', () => {
|
|
327
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
328
|
+
const contacts = Contact_1.default.parseMany(response, 0, 1000);
|
|
329
|
+
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
330
|
+
});
|
|
331
|
+
it('returns limited contacts when parsing many contacts with a smaller limit than number of results', () => {
|
|
332
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1] });
|
|
333
|
+
const contacts = Contact_1.default.parseMany(response, 0, 1);
|
|
334
|
+
expect(contacts).toEqual([parsedContact1]);
|
|
335
|
+
});
|
|
336
|
+
it('returns all contacts when parsing many contacts with same limit than number of results', () => {
|
|
337
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
338
|
+
const contacts = Contact_1.default.parseMany(response, 0, 2);
|
|
339
|
+
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
340
|
+
});
|
|
341
|
+
it('returns an empty array when parsing many contact with limit of 0', () => {
|
|
342
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
343
|
+
const contacts = Contact_1.default.parseMany(response, 0, 0);
|
|
344
|
+
expect(contacts).toEqual([]);
|
|
345
|
+
});
|
|
346
|
+
it('returns all contacts when parsing many contacts with a negative limit', () => {
|
|
347
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
348
|
+
const contacts = Contact_1.default.parseMany(response, 0, -1);
|
|
349
|
+
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
350
|
+
});
|
|
351
|
+
it('returns all contacts when parsing many contacts with a null limit', () => {
|
|
352
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
353
|
+
const contacts = Contact_1.default.parseMany(response, 0, null);
|
|
354
|
+
expect(contacts).toEqual([parsedContact1, parsedContact2]);
|
|
355
|
+
});
|
|
356
|
+
it('returns all contacts after the first one when parsing many contacts with an offset of 1', () => {
|
|
357
|
+
const response = Object.assign(Object.assign({}, genericContactResponse), { results: [contact1, contact2] });
|
|
358
|
+
const contacts = Contact_1.default.parseMany(response, 1, null);
|
|
359
|
+
expect(contacts).toEqual([parsedContact2]);
|
|
360
|
+
});
|
|
236
361
|
});
|
|
@@ -166,7 +166,7 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
166
166
|
}
|
|
167
167
|
// Overridden to avoid to use peerConnection.getReceivers and peerConnection.getSenders in react-native
|
|
168
168
|
close() {
|
|
169
|
-
var _a, _b;
|
|
169
|
+
var _a, _b, _c;
|
|
170
170
|
wazoLogger.info('closing sdh');
|
|
171
171
|
if (this.isWeb) {
|
|
172
172
|
return super.close();
|
|
@@ -176,20 +176,23 @@ class WazoSessionDescriptionHandler extends session_description_handler_1.Sessio
|
|
|
176
176
|
if (this._peerConnection === undefined) {
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
// Closing senders via getLocalStreams
|
|
179
|
+
// Closing senders via getLocalStreams, `getLocalStreams` is deprecated, we have to check if it exists.
|
|
180
180
|
// @ts-ignore
|
|
181
|
-
(_a = this.peerConnection) === null || _a === void 0 ? void 0 : _a.getLocalStreams
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
if ((_a = this.peerConnection) === null || _a === void 0 ? void 0 : _a.getLocalStreams) {
|
|
182
|
+
// @ts-ignore
|
|
183
|
+
(_b = this.peerConnection) === null || _b === void 0 ? void 0 : _b.getLocalStreams().forEach(stream => {
|
|
184
|
+
stream.getTracks()
|
|
185
|
+
.filter((track) => track.enabled)
|
|
186
|
+
.forEach((track) => track.stop());
|
|
184
187
|
});
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
// Closing receivers via getRemoteStreams
|
|
189
|
+
// @ts-ignore
|
|
190
|
+
(_c = this.peerConnection) === null || _c === void 0 ? void 0 : _c.getRemoteStreams().forEach(stream => {
|
|
191
|
+
stream.getTracks()
|
|
192
|
+
.filter((track) => track.enabled)
|
|
193
|
+
.forEach((track) => track.stop());
|
|
191
194
|
});
|
|
192
|
-
}
|
|
195
|
+
}
|
|
193
196
|
if (this._dataChannel) {
|
|
194
197
|
this._dataChannel.close();
|
|
195
198
|
}
|
|
@@ -17,7 +17,7 @@ const ERROR = 'error';
|
|
|
17
17
|
const CONSOLE_METHODS = [INFO, LOG, WARN, ERROR];
|
|
18
18
|
const LOG_LEVELS = [TRACE, DEBUG, INFO, LOG, WARN, ERROR];
|
|
19
19
|
const CATEGORY_PREFIX = 'logger-category=';
|
|
20
|
-
const MAX_REMOTE_RETRY =
|
|
20
|
+
const MAX_REMOTE_RETRY = 10;
|
|
21
21
|
const addLevelsTo = (instance, withMethods = false) => {
|
|
22
22
|
instance.TRACE = TRACE;
|
|
23
23
|
instance.DEBUG = DEBUG;
|
|
@@ -251,6 +251,14 @@ class IssueReporter {
|
|
|
251
251
|
this.bufferTimeout = null;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
+
_computeRetryDelay(attempt, initial = 1000, maxWait = 50000) {
|
|
255
|
+
// min wait is initial(attempt = 0)
|
|
256
|
+
// later retries are randomly distributed between initial wait and exponential
|
|
257
|
+
const base = 1.5;
|
|
258
|
+
const wait = Math.min(initial * Math.pow(base, attempt), maxWait);
|
|
259
|
+
const jitterWait = Math.max(initial, Math.random() * wait);
|
|
260
|
+
return jitterWait;
|
|
261
|
+
}
|
|
254
262
|
_sendDebugToGrafana(payload, retry = 0) {
|
|
255
263
|
if (!this.remoteClientConfiguration || retry >= MAX_REMOTE_RETRY) {
|
|
256
264
|
return;
|
|
@@ -270,6 +278,8 @@ class IssueReporter {
|
|
|
270
278
|
// @ts-ignore
|
|
271
279
|
e.skipSendToRemote = true;
|
|
272
280
|
this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
|
|
281
|
+
// wait at least 1 second, at most 50 seconds
|
|
282
|
+
const wait = this._computeRetryDelay(retry, 1000, 50000);
|
|
273
283
|
setTimeout(() => {
|
|
274
284
|
if (Array.isArray(payload)) {
|
|
275
285
|
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
@@ -278,7 +288,7 @@ class IssueReporter {
|
|
|
278
288
|
payload = this._writeRetryCount(payload, retry + 1);
|
|
279
289
|
}
|
|
280
290
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
281
|
-
},
|
|
291
|
+
}, wait);
|
|
282
292
|
});
|
|
283
293
|
}
|
|
284
294
|
_writeRetryCount(message, count) {
|
|
@@ -102,4 +102,16 @@ describe('IssueReporter', () => {
|
|
|
102
102
|
_retry: 1,
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
|
+
it('retry delay', () => {
|
|
106
|
+
expect(IssueReporter_1.default._computeRetryDelay(0, 1000, 50000)).toBe(1000);
|
|
107
|
+
expect(IssueReporter_1.default._computeRetryDelay(1, 1000, 50000)).toBeGreaterThanOrEqual(1000);
|
|
108
|
+
const samples = [];
|
|
109
|
+
for (let i = 0; i <= 10; i++) {
|
|
110
|
+
samples.push(IssueReporter_1.default._computeRetryDelay(i, 1000, 50000));
|
|
111
|
+
}
|
|
112
|
+
const min = Math.min(...samples);
|
|
113
|
+
expect(min).toBe(1000);
|
|
114
|
+
const max = Math.max(...samples);
|
|
115
|
+
expect(max).toBeLessThanOrEqual(50000);
|
|
116
|
+
});
|
|
105
117
|
});
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setFetchOptions = exports.setIsMobile = exports.setRefreshBackend = exports.setRefreshExpiration = exports.setOnRefreshTokenError = exports.setOnRefreshToken = exports.setRefreshDomainName = exports.setRefreshTenantId = exports.setRefreshToken = exports.setApiToken = exports.setCurrentServer = exports.setApiClientId = void 0;
|
|
6
|
+
exports.getFetchOptions = exports.setFetchOptions = exports.setRequestTimeout = exports.setIsMobile = exports.setRefreshBackend = exports.setRefreshExpiration = exports.setOnRefreshTokenError = exports.setOnRefreshToken = exports.setRefreshDomainName = exports.setRefreshTenantId = exports.setRefreshToken = exports.setApiToken = exports.setCurrentServer = exports.setApiClientId = void 0;
|
|
7
7
|
/* eslint-disable dot-notation */
|
|
8
8
|
const api_client_1 = __importDefault(require("../api-client"));
|
|
9
9
|
// Can't use node cache mechanism here because when requiring lib/CallApi.js
|
|
@@ -20,6 +20,7 @@ global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
|
20
20
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
21
21
|
global.wazoRefreshBackend = global.wazoRefreshBackend || {};
|
|
22
22
|
global.wazoIsMobile = global.wazoIsMobile || {};
|
|
23
|
+
global.wazoRequestApiTimeout = global.wazoRequestApiTimeout || {};
|
|
23
24
|
global.wazoFetchOptions = global.wazoFetchOptions || {};
|
|
24
25
|
const setApiClientId = (clientId, forServer = null) => {
|
|
25
26
|
global.wazoClientId[String(forServer)] = clientId;
|
|
@@ -66,13 +67,20 @@ const setIsMobile = (isMobile, forServer = null) => {
|
|
|
66
67
|
global.wazoIsMobile[String(forServer)] = isMobile;
|
|
67
68
|
};
|
|
68
69
|
exports.setIsMobile = setIsMobile;
|
|
70
|
+
const setRequestTimeout = (requestTimeout, forServer = null) => {
|
|
71
|
+
global.wazoRequestApiTimeout[String(forServer)] = requestTimeout;
|
|
72
|
+
};
|
|
73
|
+
exports.setRequestTimeout = setRequestTimeout;
|
|
69
74
|
const setFetchOptions = (fetchOptions, forServer = null) => {
|
|
70
75
|
global.wazoFetchOptions[String(forServer)] = fetchOptions;
|
|
71
76
|
};
|
|
72
77
|
exports.setFetchOptions = setFetchOptions;
|
|
78
|
+
const getFetchOptions = (forServer = null) => (forServer ? global.wazoFetchOptions[forServer] : global.wazoFetchOptions.null) || global.wazoFetchOptions.null;
|
|
79
|
+
exports.getFetchOptions = getFetchOptions;
|
|
73
80
|
const fillClient = (apiClient) => {
|
|
74
81
|
const { server, token, clientId, } = apiClient.client;
|
|
75
82
|
const tenantId = global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId.null || apiClient.refreshTenantId;
|
|
83
|
+
const requestTimeout = global.wazoRequestApiTimeout[server] || global.wazoRequestApiTimeout.null;
|
|
76
84
|
// try with null server when dealing with non-related server info
|
|
77
85
|
apiClient.setToken(global.wazoClientToken[server] || global.wazoClientToken.null || token);
|
|
78
86
|
apiClient.setClientId(global.wazoClientId[server] || global.wazoClientId.null || clientId);
|
|
@@ -87,6 +95,9 @@ const fillClient = (apiClient) => {
|
|
|
87
95
|
apiClient.setRefreshExpiration(global.wazoRefreshExpiration[server] || global.wazoRefreshExpiration.null || apiClient.refreshExpiration);
|
|
88
96
|
apiClient.setRefreshBackend(global.wazoRefreshBackend[server] || global.wazoRefreshBackend.null || apiClient.refreshBackend);
|
|
89
97
|
apiClient.setIsMobile(global.wazoIsMobile[server] || global.wazoIsMobile.null || apiClient.isMobile);
|
|
98
|
+
if (requestTimeout) {
|
|
99
|
+
apiClient.setRequestTimeout(requestTimeout);
|
|
100
|
+
}
|
|
90
101
|
return apiClient;
|
|
91
102
|
};
|
|
92
103
|
exports.default = ((forServer = null) => {
|
package/lib/simple/Auth.js
CHANGED
|
@@ -61,6 +61,7 @@ class Auth {
|
|
|
61
61
|
this.minSubscriptionType = null;
|
|
62
62
|
this.BACKEND_WAZO = auth_1.DEFAULT_BACKEND_USER;
|
|
63
63
|
this.BACKEND_LDAP = auth_1.BACKEND_LDAP_USER;
|
|
64
|
+
this.shouldCheckUserUuidHeader = true;
|
|
64
65
|
}
|
|
65
66
|
init(clientId, expiration, minSubscriptionType, authorizationName, mobile) {
|
|
66
67
|
this.clientId = clientId;
|
|
@@ -172,17 +173,22 @@ class Auth {
|
|
|
172
173
|
yield (0, getApiClient_1.default)().auth.deleteRefreshToken(this.clientId);
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
|
-
catch (e) {
|
|
176
|
+
catch (e) {
|
|
177
|
+
// Nothing to
|
|
176
178
|
}
|
|
177
179
|
try {
|
|
178
|
-
|
|
180
|
+
if ((_a = this.session) === null || _a === void 0 ? void 0 : _a.token) {
|
|
181
|
+
yield (0, getApiClient_1.default)().auth.logOut(this.session.token);
|
|
182
|
+
}
|
|
179
183
|
}
|
|
180
|
-
catch (e) {
|
|
184
|
+
catch (e) {
|
|
185
|
+
// Nothing to
|
|
181
186
|
}
|
|
182
187
|
(0, getApiClient_1.setApiToken)(null);
|
|
183
188
|
(0, getApiClient_1.setRefreshToken)(null);
|
|
184
189
|
this.session = null;
|
|
185
190
|
this.authenticated = false;
|
|
191
|
+
(0, getApiClient_1.setFetchOptions)({});
|
|
186
192
|
});
|
|
187
193
|
}
|
|
188
194
|
setOnRefreshToken(callback) {
|
|
@@ -227,8 +233,12 @@ class Auth {
|
|
|
227
233
|
(0, getApiClient_1.setRefreshDomainName)(domainName);
|
|
228
234
|
(0, getApiClient_1.default)().setRefreshDomainName(domainName);
|
|
229
235
|
}
|
|
236
|
+
setRequestTimeout(requestTimeout) {
|
|
237
|
+
(0, getApiClient_1.setRequestTimeout)(requestTimeout);
|
|
238
|
+
(0, getApiClient_1.default)().setRequestTimeout(requestTimeout);
|
|
239
|
+
}
|
|
230
240
|
forceRefreshToken() {
|
|
231
|
-
(0, getApiClient_1.default)().forceRefreshToken();
|
|
241
|
+
return (0, getApiClient_1.default)().forceRefreshToken();
|
|
232
242
|
}
|
|
233
243
|
setIsMobile(mobile) {
|
|
234
244
|
this.mobile = mobile;
|
|
@@ -258,6 +268,25 @@ class Auth {
|
|
|
258
268
|
getName() {
|
|
259
269
|
return `${this.getFirstName()} ${this.getLastName()}`;
|
|
260
270
|
}
|
|
271
|
+
setHttpUserUuidHeader(uuid) {
|
|
272
|
+
var _a;
|
|
273
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
+
if (!uuid) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const headers = Object.assign(Object.assign({}, (((_a = (0, getApiClient_1.getFetchOptions)()) === null || _a === void 0 ? void 0 : _a.headers) || {})), { 'X-User-UUID': uuid });
|
|
278
|
+
try {
|
|
279
|
+
if (this.shouldCheckUserUuidHeader) {
|
|
280
|
+
yield (0, getApiClient_1.default)().client.head('auth/0.1/status', null, headers);
|
|
281
|
+
}
|
|
282
|
+
// If the previous request went well, it means that the header is accepted
|
|
283
|
+
(0, getApiClient_1.setFetchOptions)(Object.assign(Object.assign({}, (0, getApiClient_1.getFetchOptions)()), { headers }));
|
|
284
|
+
}
|
|
285
|
+
catch (_) {
|
|
286
|
+
// Nothing to do
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
261
290
|
_onAuthenticated(rawSession) {
|
|
262
291
|
var _a;
|
|
263
292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -265,6 +294,7 @@ class Auth {
|
|
|
265
294
|
return this.session;
|
|
266
295
|
}
|
|
267
296
|
const session = rawSession;
|
|
297
|
+
yield this.setHttpUserUuidHeader(session.uuid);
|
|
268
298
|
if (!session) {
|
|
269
299
|
return null;
|
|
270
300
|
}
|
package/lib/simple/Phone.js
CHANGED
|
@@ -58,8 +58,9 @@ class Phone extends Emitter_1.default {
|
|
|
58
58
|
});
|
|
59
59
|
this.SessionState = session_state_1.SessionState;
|
|
60
60
|
}
|
|
61
|
-
connect(
|
|
61
|
+
connect(rawOptions = {}, sipLine = null) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const options = rawOptions;
|
|
63
64
|
if (this.phone) {
|
|
64
65
|
// Already connected
|
|
65
66
|
// let's update media constraints if they're being fed
|
|
@@ -78,6 +79,7 @@ class Phone extends Emitter_1.default {
|
|
|
78
79
|
if (!this.sipLine) {
|
|
79
80
|
throw new Error('Sorry, no sip lines found for this user');
|
|
80
81
|
}
|
|
82
|
+
options.userUuid = session.uuid || '';
|
|
81
83
|
this.connectWithCredentials(server, this.sipLine, session.displayName(), options);
|
|
82
84
|
});
|
|
83
85
|
}
|
package/lib/simple/Websocket.js
CHANGED
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const index_1 = __importDefault(require("../index"));
|
|
8
8
|
class Stream {
|
|
9
9
|
static detachStream(stream) {
|
|
10
|
-
stream.getTracks()
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
stream.getTracks()
|
|
11
|
+
.filter((track) => track.enabled)
|
|
12
|
+
.forEach((track) => track.stop());
|
|
13
13
|
}
|
|
14
14
|
constructor(htmlStream, participant) {
|
|
15
15
|
this.htmlStream = htmlStream;
|
package/lib/types/api/chatd.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface ChatD {
|
|
|
30
30
|
getState: (contactUuid: UUID) => Promise<string>;
|
|
31
31
|
getContactStatusInfo: (contactUuid: UUID) => Promise<PresenceResponse>;
|
|
32
32
|
getLineState: (contactUuid: UUID) => Promise<string>;
|
|
33
|
-
getMultipleLineState: (contactUuids: Array<UUID> | null | undefined) => Promise<
|
|
33
|
+
getMultipleLineState: (contactUuids: Array<UUID> | null | undefined) => Promise<Array<PresenceResponse>>;
|
|
34
34
|
getUserRooms: () => Promise<Array<ChatRoom>>;
|
|
35
35
|
createRoom: (name: string, users: Array<ChatUser>) => Promise<ChatRoom>;
|
|
36
36
|
getRoomMessages: (roomUuid: string, params?: GetMessagesOptions) => Prom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M,EAAE,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAClF,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACpE;iCAKwB,YAAY,WAAW,MAAM,KAAG,KAAK;AAA9D,wBAiDI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dird.d.ts","sourceRoot":"","sources":["../../../src/api/dird.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"dird.d.ts","sourceRoot":"","sources":["../../../src/api/dird.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAiBxC,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,oBAAoB,EAAE,CAAC,WAAW,CAAC,EAAE,wBAAwB,KAAK,OAAO,CA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,CAAC,CAAC;IACzD,mBAAmB,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,wBAAwB,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/H,qBAAqB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7D,uBAAuB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5F,4BAA4B,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CACvG;AAED,KAAK,wBAAwB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC;iCACgB,YAAY,WAAW,MAAM,KAAG,IAAI;AAA7D,wBA6FI"}
|
|
@@ -43,11 +43,12 @@ export default class ApiClient {
|
|
|
43
43
|
constructor({ server, agent, refreshToken, clientId, isMobile, fetchOptions, }: ConstructorParams);
|
|
44
44
|
initializeEndpoints(): void;
|
|
45
45
|
updateParameters({ server, agent, clientId, fetchOptions, }: Record<string, any>): void;
|
|
46
|
-
forceRefreshToken(): Promise<string | null
|
|
47
|
-
refreshTokenCallback(): Promise<string | null
|
|
46
|
+
forceRefreshToken(): Promise<string | null>;
|
|
47
|
+
refreshTokenCallback(): Promise<string | null>;
|
|
48
48
|
setToken(token: string): void;
|
|
49
49
|
setTenant(tenant: string): void;
|
|
50
50
|
setRefreshToken(refreshToken: string | null | undefined): void;
|
|
51
|
+
setRequestTimeout(requestTimeout: number): void;
|
|
51
52
|
setClientId(clientId: string | null | undefined): void;
|
|
52
53
|
setOnRefreshToken(onRefreshToken: (...args: Array<any>) => any): void;
|
|
53
54
|
setOnRefreshTokenError(callback: (...args: Array<any>) => any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAoB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAChD,OAA2B,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAqB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAsB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAoB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAwB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAqB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAqB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAsB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACrD,OAAwB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAoB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAGjD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,MA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AG,IAAI,CAAC;IAK3C,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAyCpD,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,SAAS,CAAC,MAAM,EAAE,MAAM;IAIxB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIvD,iBAAiB,CAAC,cAAc,EAAE,MAAM;IAIxC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAI/C,iBAAiB,CAAC,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG;IAI9D,sBAAsB,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG;IAI7D,oBAAoB,CAAC,iBAAiB,EAAE,MAAM;IAI9C,iBAAiB,CAAC,cAAc,EAAE,MAAM;IAIxC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAKtD,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAI1D,WAAW,CAAC,QAAQ,EAAE,OAAO;IAI7B,eAAe,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAKjD,mBAAmB;CAIpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ice-ipv4.d.ts","sourceRoot":"","sources":["../../../../src/checker/checks/ice-ipv4.ts"],"names":[],"mappings":";;oBAgBkB,MAAM,WAAW,GAAG,qBAAqB,OAAO,MAAM,EAAE,GAAG,CAAC;;AAF9E,
|
|
1
|
+
{"version":3,"file":"ice-ipv4.d.ts","sourceRoot":"","sources":["../../../../src/checker/checks/ice-ipv4.ts"],"names":[],"mappings":";;oBAgBkB,MAAM,WAAW,GAAG,qBAAqB,OAAO,MAAM,EAAE,GAAG,CAAC;;AAF9E,wBAkEE"}
|
|
@@ -271,7 +271,7 @@ export default class Contact {
|
|
|
271
271
|
lines: Record<string, any>[];
|
|
272
272
|
static merge(oldContacts: Array<Contact>, newContacts: Array<Contact>): Array<Contact>;
|
|
273
273
|
static sortContacts(a: Contact, b: Contact): number;
|
|
274
|
-
static parseMany(response: ContactsResponse): Array<Contact>;
|
|
274
|
+
static parseMany(response: ContactsResponse, offset?: number, limit?: (number | null)): Array<Contact>;
|
|
275
275
|
static manyGraphQlWithNumbersParser(numbers: string[]): (...args: Array<any>) => any;
|
|
276
276
|
static fetchNumbers(plain: ContactResponse, columns: Array<string | null | undefined>): Array<string>;
|
|
277
277
|
static parse(plain: ContactResponse, columns: Array<string | null | undefined>): Contact;
|