@twilio/mcs-client 0.6.0-rc.9 → 0.6.1
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/CHANGELOG.md +27 -0
- package/builds/browser.js +12 -5
- package/builds/browser.js.map +1 -1
- package/builds/lib.js +12 -5
- package/builds/lib.js.map +1 -1
- package/builds/twilio-mcs-client.js +386 -211
- package/builds/twilio-mcs-client.min.js +3 -3
- package/dist/packages/mcs-client/package.json.js +1 -1
- package/dist/services/transport.js +15 -6
- package/dist/services/transport.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [0.6.1](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/mcs-client@0.6.1-rc.1...@twilio/mcs-client@0.6.1) (2022-09-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @twilio/mcs-client
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### [0.6.1-rc.1](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/mcs-client@0.6.0-rc.5...@twilio/mcs-client@0.6.1-rc.1) (2022-09-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Fix request error message ([9692911](https://github.com/twilio/rtd-sdk-monorepo-js/commit/96929111e9f83e6f09bce0bc8d8527f62ae051d9))
|
|
20
|
+
* Rollback twilsock type, update loglevel version ([d318c5c](https://github.com/twilio/rtd-sdk-monorepo-js/commit/d318c5c0750096651ce1e01fef360aded070bb5c))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## [0.6.0-rc.10](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/mcs-client@0.6.0-rc.9...@twilio/mcs-client@0.6.0-rc.10) (2022-09-13)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* Fix request error message ([7847cc3](https://github.com/twilio/rtd-sdk-monorepo-js/commit/7847cc31a78fd8f099571a02dad8e2db1e412132))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [0.6.0-rc.9](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/mcs-client@0.6.0-rc.8...@twilio/mcs-client@0.6.0-rc.9) (2022-08-23)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @twilio/mcs-client
|
package/builds/browser.js
CHANGED
|
@@ -42,6 +42,7 @@ require('core-js/modules/es.string.starts-with.js');
|
|
|
42
42
|
require('core-js/modules/es.array.reduce.js');
|
|
43
43
|
require('core-js/modules/es.regexp.exec.js');
|
|
44
44
|
require('core-js/modules/es.string.split.js');
|
|
45
|
+
require('core-js/modules/es.string.replace.js');
|
|
45
46
|
require('core-js/modules/es.json.stringify.js');
|
|
46
47
|
require('core-js/modules/es.object.assign.js');
|
|
47
48
|
require('core-js/modules/web.url.js');
|
|
@@ -700,13 +701,13 @@ class Transport {
|
|
|
700
701
|
return;
|
|
701
702
|
}
|
|
702
703
|
|
|
703
|
-
var
|
|
704
|
+
var responseHeaders = parseResponseHeaders(xhr.getAllResponseHeaders());
|
|
704
705
|
var body = extractBody(xhr);
|
|
705
706
|
|
|
706
707
|
if (200 <= xhr.status && xhr.status < 300) {
|
|
707
708
|
resolve({
|
|
708
709
|
status: xhr.status,
|
|
709
|
-
headers,
|
|
710
|
+
headers: responseHeaders,
|
|
710
711
|
body
|
|
711
712
|
});
|
|
712
713
|
} else {
|
|
@@ -716,13 +717,19 @@ class Transport {
|
|
|
716
717
|
var bodyRepresentation;
|
|
717
718
|
|
|
718
719
|
if (typeof body === "string") {
|
|
719
|
-
|
|
720
|
+
if (body && body.split("\n", 2).length === 1) bodyRepresentation = body;else {
|
|
721
|
+
var _body$replace$split$f;
|
|
722
|
+
|
|
723
|
+
// TODO: RTDSDK-3716: investigate why body is HTML string
|
|
724
|
+
var errorInfo = (_body$replace$split$f = body.replace(/<.*?>/g, "").split(/\r\n/g).filter(str => str.length)[0]) === null || _body$replace$split$f === void 0 ? void 0 : _body$replace$split$f.split(" ");
|
|
725
|
+
bodyRepresentation = (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.length) > 2 ? errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.slice(1).join(" ") : "";
|
|
726
|
+
}
|
|
720
727
|
} else {
|
|
721
728
|
bodyRepresentation = JSON.stringify(body);
|
|
722
729
|
}
|
|
723
730
|
|
|
724
731
|
var message = "".concat(xhr.status, ": [").concat(status, "] ").concat(bodyRepresentation);
|
|
725
|
-
reject(new TransportError(message, xhr.status, body, status,
|
|
732
|
+
reject(new TransportError(message, xhr.status, body, status, responseHeaders));
|
|
726
733
|
}
|
|
727
734
|
};
|
|
728
735
|
|
|
@@ -987,7 +994,7 @@ class Network {
|
|
|
987
994
|
|
|
988
995
|
}
|
|
989
996
|
|
|
990
|
-
var version = "0.6.
|
|
997
|
+
var version = "0.6.1";
|
|
991
998
|
|
|
992
999
|
var _class;
|
|
993
1000
|
var log = Logger.scope("");
|