@webex/webex-core 3.8.1 → 3.9.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.
Files changed (85) hide show
  1. package/README.md +87 -27
  2. package/dist/index.js +9 -33
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/batcher.js +1 -1
  5. package/dist/lib/constants.js +10 -1
  6. package/dist/lib/constants.js.map +1 -1
  7. package/dist/lib/credentials/credentials.js +1 -1
  8. package/dist/lib/credentials/token.js +1 -1
  9. package/dist/lib/{services-v2/interceptors → interceptors}/server-error.js +1 -1
  10. package/dist/lib/interceptors/server-error.js.map +1 -0
  11. package/dist/lib/services/index.js +2 -29
  12. package/dist/lib/services/index.js.map +1 -1
  13. package/dist/lib/services/service-host.js +1 -1
  14. package/dist/lib/services/service-host.js.map +1 -1
  15. package/dist/lib/services/service-registry.js +1 -1
  16. package/dist/lib/services/service-registry.js.map +1 -1
  17. package/dist/lib/services/service-state.js +1 -1
  18. package/dist/lib/services/service-state.js.map +1 -1
  19. package/dist/lib/services/services.js +3 -3
  20. package/dist/lib/services/services.js.map +1 -1
  21. package/dist/lib/services-v2/index.js +0 -29
  22. package/dist/lib/services-v2/index.js.map +1 -1
  23. package/dist/lib/services-v2/metrics.js.map +1 -1
  24. package/dist/lib/services-v2/service-catalog.js +11 -10
  25. package/dist/lib/services-v2/service-catalog.js.map +1 -1
  26. package/dist/lib/services-v2/services-v2.js +56 -67
  27. package/dist/lib/services-v2/services-v2.js.map +1 -1
  28. package/dist/lib/services-v2/types.js.map +1 -1
  29. package/dist/plugins/logger.js +1 -1
  30. package/dist/webex-core.js +3 -3
  31. package/dist/webex-core.js.map +1 -1
  32. package/package.json +13 -13
  33. package/src/index.js +5 -14
  34. package/src/lib/constants.js +29 -1
  35. package/src/lib/{services/interceptors → interceptors}/server-error.js +1 -1
  36. package/src/lib/services/index.js +2 -7
  37. package/src/lib/services/service-host.js +1 -1
  38. package/src/lib/services/service-registry.js +1 -1
  39. package/src/lib/services/service-state.js +1 -1
  40. package/src/lib/services/services.js +2 -2
  41. package/src/lib/services-v2/index.ts +0 -16
  42. package/src/lib/services-v2/service-catalog.ts +20 -19
  43. package/src/lib/services-v2/{services-v2.js → services-v2.ts} +116 -94
  44. package/src/lib/services-v2/types.ts +62 -2
  45. package/src/webex-core.js +1 -1
  46. package/test/fixtures/host-catalog-v2.ts +30 -122
  47. package/test/integration/spec/services/services.js +11 -0
  48. package/test/integration/spec/services-v2/service-catalog.js +664 -0
  49. package/test/integration/spec/services-v2/services-v2.js +1061 -0
  50. package/test/unit/spec/services-v2/service-detail.ts +1 -1
  51. package/test/unit/spec/services-v2/services-v2.ts +390 -436
  52. package/dist/lib/services/constants.js +0 -17
  53. package/dist/lib/services/constants.js.map +0 -1
  54. package/dist/lib/services/interceptors/hostmap.js +0 -64
  55. package/dist/lib/services/interceptors/hostmap.js.map +0 -1
  56. package/dist/lib/services/interceptors/server-error.js +0 -77
  57. package/dist/lib/services/interceptors/server-error.js.map +0 -1
  58. package/dist/lib/services/interceptors/service.js +0 -137
  59. package/dist/lib/services/interceptors/service.js.map +0 -1
  60. package/dist/lib/services-v2/constants.js +0 -17
  61. package/dist/lib/services-v2/constants.js.map +0 -1
  62. package/dist/lib/services-v2/interceptors/server-error.js.map +0 -1
  63. package/dist/lib/services-v2/service-host.js +0 -300
  64. package/dist/lib/services-v2/service-host.js.map +0 -1
  65. package/dist/lib/services-v2/service-registry.js +0 -534
  66. package/dist/lib/services-v2/service-registry.js.map +0 -1
  67. package/dist/lib/services-v2/service-state.js +0 -97
  68. package/dist/lib/services-v2/service-state.js.map +0 -1
  69. package/dist/lib/services-v2/service-url.js +0 -119
  70. package/dist/lib/services-v2/service-url.js.map +0 -1
  71. package/src/lib/services/constants.js +0 -21
  72. package/src/lib/services/interceptors/hostmap.js +0 -36
  73. package/src/lib/services/interceptors/service.js +0 -101
  74. package/src/lib/services-v2/constants.ts +0 -21
  75. package/src/lib/services-v2/interceptors/server-error.js +0 -48
  76. /package/dist/lib/{services-v2/interceptors → interceptors}/hostmap.js +0 -0
  77. /package/dist/lib/{services-v2/interceptors → interceptors}/hostmap.js.map +0 -0
  78. /package/dist/lib/{services-v2/interceptors → interceptors}/service.js +0 -0
  79. /package/dist/lib/{services-v2/interceptors → interceptors}/service.js.map +0 -0
  80. /package/dist/lib/{services/metrics.js → metrics.js} +0 -0
  81. /package/dist/lib/{services/metrics.js.map → metrics.js.map} +0 -0
  82. /package/src/lib/{services-v2/interceptors → interceptors}/hostmap.js +0 -0
  83. /package/src/lib/{services-v2/interceptors → interceptors}/service.js +0 -0
  84. /package/src/lib/{services-v2/metrics.js → metrics.js} +0 -0
  85. /package/src/lib/{services/metrics.js → services-v2/metrics.ts} +0 -0
@@ -1,125 +1,3 @@
1
- export const serviceHostmapV2 = {
2
- activeServices: {
3
- conversation: 'urn:TEAM:us-east-2_a:conversation',
4
- idbroker: 'urn:TEAM:us-east-2_a:idbroker',
5
- locus: 'urn:TEAM:us-east-2_a:locus',
6
- mercury: 'urn:TEAM:us-east-2_a:mercury',
7
- },
8
- services: [
9
- {
10
- id: 'urn:TEAM:us-east-2_a:conversation',
11
- serviceName: 'conversation',
12
- serviceUrls: [
13
- {
14
- baseUrl: 'https://prod-achm-message.svc.webex.com/conversation/api/v1',
15
- priority: 1,
16
- },
17
- {
18
- baseUrl: 'https://conv-a.wbx2.com/conversation/api/v1',
19
- priority: 2,
20
- },
21
- ],
22
- },
23
- {
24
- id: 'urn:TEAM:me-central-1_d:conversation',
25
- serviceName: 'conversation',
26
- serviceUrls: [
27
- {
28
- baseUrl: 'https://prod-adxb-message.svc.webex.com/conversation/api/v1',
29
- priority: 1,
30
- },
31
- {
32
- baseUrl: 'https://conv-d.wbx2.com/conversation/api/v1',
33
- priority: 2,
34
- },
35
- ],
36
- },
37
- {
38
- id: 'urn:TEAM:us-east-2_a:idbroker',
39
- serviceName: 'idbroker',
40
- serviceUrls: [
41
- {
42
- baseUrl: 'https://prod-adxb-message.svc.webex.com/idbroker/api/v1',
43
- priority: 1,
44
- },
45
- {
46
- baseUrl: 'https://idbroker.webex.com/idb/api/v1',
47
- priority: 2,
48
- },
49
- ],
50
- },
51
- {
52
- id: 'urn:TEAM:me-central-1_d:idbroker',
53
- serviceName: 'idbroker',
54
- serviceUrls: [
55
- {
56
- baseUrl: 'https://prod-adxb-message.svc.webex.com/idbroker/api/v1',
57
- priority: 1,
58
- },
59
- {
60
- baseUrl: 'https://conv-d.wbx2.com/idbroker/api/v1',
61
- priority: 2,
62
- },
63
- ],
64
- },
65
- {
66
- id: 'urn:TEAM:us-east-2_a:locus',
67
- serviceName: 'locus',
68
- serviceUrls: [
69
- {
70
- baseUrl: 'https://prod-adxb-message.svc.webex.com/locus/api/v1',
71
- priority: 1,
72
- },
73
- {
74
- baseUrl: 'https://locus-a.wbx2.com/locus/api/v1',
75
- priority: 2,
76
- },
77
- ],
78
- },
79
- {
80
- id: 'urn:TEAM:me-central-1_d:locus',
81
- serviceName: 'locus',
82
- serviceUrls: [
83
- {
84
- baseUrl: 'https://prod-adxb-message.svc.webex.com/locus/api/v1',
85
- priority: 1,
86
- },
87
- {
88
- baseUrl: 'https://conv-d.wbx2.com/locus/api/v1',
89
- priority: 2,
90
- },
91
- ],
92
- },
93
- {
94
- id: 'urn:TEAM:us-east-2_a:mercury',
95
- serviceName: 'mercury',
96
- serviceUrls: [
97
- {
98
- baseUrl: 'https://mercury-a.wbx2.com/mercury/api/v1',
99
- priority: 1,
100
- },
101
- ],
102
- },
103
- {
104
- id: 'urn:TEAM:me-central-1_d:mercury',
105
- serviceName: 'mercury',
106
- serviceUrls: [
107
- {
108
- baseUrl: 'https://prod-adxb-message.svc.webex.com/mercury/api/v1',
109
- priority: 1,
110
- },
111
- {
112
- baseUrl: 'https://conv-d.wbx2.com/mercury/api/v1',
113
- priority: 2,
114
- },
115
- ],
116
- },
117
- ],
118
- orgId: '3e0e410f-f83f-4ee4-ac32-12692e99355c',
119
- timestamp: '1745533341',
120
- format: 'U2Cv2',
121
- };
122
-
123
1
  export const formattedServiceHostmapEntryConv = {
124
2
  id: 'urn:TEAM:us-east-2_a:conversation',
125
3
  serviceName: 'conversation',
@@ -137,6 +15,23 @@ export const formattedServiceHostmapEntryConv = {
137
15
  ],
138
16
  };
139
17
 
18
+ export const formattedServiceHostmapEntryTest = {
19
+ id: 'urn:TEAM:us-east-2_a:test',
20
+ serviceName: 'test',
21
+ serviceUrls: [
22
+ {
23
+ baseUrl: 'wss://int-first-test.svc.webex.com/test-connection-partition0/api/v1',
24
+ host: 'int-first-test.svc.webex.com',
25
+ priority: 1,
26
+ },
27
+ {
28
+ baseUrl: 'wss://test-connection-partition0-intb.ciscospark.com/v1',
29
+ host: 'test-connection-partition0-intb.ciscospark.com',
30
+ priority: 2,
31
+ },
32
+ ],
33
+ };
34
+
140
35
  export const formattedServiceHostmapV2 = [
141
36
  formattedServiceHostmapEntryConv,
142
37
  {
@@ -247,3 +142,16 @@ export const formattedServiceHostmapV2 = [
247
142
  ],
248
143
  },
249
144
  ];
145
+
146
+ export const serviceHostmapV2 = {
147
+ activeServices: {
148
+ conversation: 'urn:TEAM:us-east-2_a:conversation',
149
+ idbroker: 'urn:TEAM:us-east-2_a:idbroker',
150
+ locus: 'urn:TEAM:us-east-2_a:locus',
151
+ mercury: 'urn:TEAM:us-east-2_a:mercury',
152
+ },
153
+ services: formattedServiceHostmapV2,
154
+ orgId: '3e0e410f-f83f-4ee4-ac32-12692e99355c',
155
+ timestamp: '1745533341',
156
+ format: 'U2Cv2',
157
+ };
@@ -10,6 +10,10 @@ import WebexCore, {
10
10
  ServiceCatalog,
11
11
  ServiceRegistry,
12
12
  ServiceState,
13
+ Services,
14
+ ServiceInterceptor,
15
+ ServerErrorInterceptor,
16
+ registerInternalPlugin,
13
17
  ServiceUrl,
14
18
  serviceConstants,
15
19
  } from '@webex/webex-core';
@@ -50,6 +54,13 @@ describe('webex-core', () => {
50
54
  );
51
55
 
52
56
  beforeEach('create webex instance', () => {
57
+ registerInternalPlugin('services', Services, {
58
+ interceptors: {
59
+ ServiceInterceptor: ServiceInterceptor.create,
60
+ ServerErrorInterceptor: ServerErrorInterceptor.create,
61
+ },
62
+ replace: true,
63
+ });
53
64
  webex = new WebexCore({credentials: {supertoken: webexUser.token}});
54
65
  webexEU = new WebexCore({credentials: {supertoken: webexUserEU.token}});
55
66
  services = webex.internal.services;