@webex/http-core 2.59.2 → 2.59.3-next.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.
Files changed (43) hide show
  1. package/.eslintrc.js +6 -6
  2. package/README.md +64 -64
  3. package/babel.config.js +3 -3
  4. package/dist/http-error-subtypes.js +57 -57
  5. package/dist/http-error-subtypes.js.map +1 -1
  6. package/dist/http-error.js +25 -25
  7. package/dist/http-error.js.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/interceptors/http-status.js +13 -13
  10. package/dist/interceptors/http-status.js.map +1 -1
  11. package/dist/lib/detect.js +6 -6
  12. package/dist/lib/detect.js.map +1 -1
  13. package/dist/lib/interceptor.js +34 -34
  14. package/dist/lib/interceptor.js.map +1 -1
  15. package/dist/lib/xhr.js +2 -2
  16. package/dist/lib/xhr.js.map +1 -1
  17. package/dist/progress-event.js +6 -6
  18. package/dist/progress-event.js.map +1 -1
  19. package/dist/request/index.js +11 -11
  20. package/dist/request/index.js.map +1 -1
  21. package/dist/request/request.js +14 -14
  22. package/dist/request/request.js.map +1 -1
  23. package/dist/request/request.shim.js +65 -65
  24. package/dist/request/request.shim.js.map +1 -1
  25. package/jest.config.js +3 -3
  26. package/package.json +18 -17
  27. package/process +1 -1
  28. package/src/http-error-subtypes.js +187 -187
  29. package/src/http-error.js +147 -147
  30. package/src/index.js +58 -58
  31. package/src/interceptors/http-status.js +63 -63
  32. package/src/lib/detect.js +33 -33
  33. package/src/lib/interceptor.js +95 -95
  34. package/src/lib/xhr.js +258 -258
  35. package/src/progress-event.js +37 -37
  36. package/src/request/index.js +62 -62
  37. package/src/request/request.js +109 -109
  38. package/src/request/request.shim.js +304 -304
  39. package/test/integration/spec/http-error.js +188 -188
  40. package/test/integration/spec/interceptor.js +71 -71
  41. package/test/integration/spec/progress-event.js +83 -83
  42. package/test/integration/spec/request.js +310 -310
  43. package/test/unit/spec/interceptors/http-status.js +49 -49
@@ -1,49 +1,49 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- import {assert} from '@webex/test-helper-chai';
6
- import {HttpStatusInterceptor} from '@webex/http-core';
7
-
8
- describe('http-core', () => {
9
- describe('Interceptors', () => {
10
- describe('HttpStatusInterceptor', () => {
11
- let interceptor;
12
-
13
- beforeEach(() => {
14
- interceptor = Reflect.apply(
15
- HttpStatusInterceptor.create,
16
- {
17
- sessionId: 'mock-webex_uuid',
18
- },
19
- []
20
- );
21
- });
22
-
23
- describe('#onResponse', () => {
24
- it('resolves on locus redirect error', () => {
25
- const response = {
26
- statusCode: 404,
27
- body: {
28
- errorCode: 2000002,
29
- },
30
- };
31
-
32
- return interceptor.onResponse({}, response).then((result) => {
33
- assert.equal(result, response);
34
- });
35
- });
36
- it('rejects when locus redirect is not intended', () => {
37
- const response = {
38
- statusCode: 404,
39
- body: {
40
- errorCode: 2000001,
41
- },
42
- };
43
-
44
- assert.isRejected(interceptor.onResponse({}, response));
45
- });
46
- });
47
- });
48
- });
49
- });
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {assert} from '@webex/test-helper-chai';
6
+ import {HttpStatusInterceptor} from '@webex/http-core';
7
+
8
+ describe('http-core', () => {
9
+ describe('Interceptors', () => {
10
+ describe('HttpStatusInterceptor', () => {
11
+ let interceptor;
12
+
13
+ beforeEach(() => {
14
+ interceptor = Reflect.apply(
15
+ HttpStatusInterceptor.create,
16
+ {
17
+ sessionId: 'mock-webex_uuid',
18
+ },
19
+ []
20
+ );
21
+ });
22
+
23
+ describe('#onResponse', () => {
24
+ it('resolves on locus redirect error', () => {
25
+ const response = {
26
+ statusCode: 404,
27
+ body: {
28
+ errorCode: 2000002,
29
+ },
30
+ };
31
+
32
+ return interceptor.onResponse({}, response).then((result) => {
33
+ assert.equal(result, response);
34
+ });
35
+ });
36
+ it('rejects when locus redirect is not intended', () => {
37
+ const response = {
38
+ statusCode: 404,
39
+ body: {
40
+ errorCode: 2000001,
41
+ },
42
+ };
43
+
44
+ assert.isRejected(interceptor.onResponse({}, response));
45
+ });
46
+ });
47
+ });
48
+ });
49
+ });