@webex/webex-core 3.0.0-beta.2 → 3.0.0-beta.21

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 (184) hide show
  1. package/dist/config.js +1 -11
  2. package/dist/config.js.map +1 -1
  3. package/dist/credentials-config.js +44 -64
  4. package/dist/credentials-config.js.map +1 -1
  5. package/dist/index.js +0 -76
  6. package/dist/index.js.map +1 -1
  7. package/dist/interceptors/auth.js +22 -55
  8. package/dist/interceptors/auth.js.map +1 -1
  9. package/dist/interceptors/default-options.js +0 -20
  10. package/dist/interceptors/default-options.js.map +1 -1
  11. package/dist/interceptors/embargo.js +0 -21
  12. package/dist/interceptors/embargo.js.map +1 -1
  13. package/dist/interceptors/network-timing.js +2 -21
  14. package/dist/interceptors/network-timing.js.map +1 -1
  15. package/dist/interceptors/payload-transformer.js +2 -22
  16. package/dist/interceptors/payload-transformer.js.map +1 -1
  17. package/dist/interceptors/rate-limit.js +25 -57
  18. package/dist/interceptors/rate-limit.js.map +1 -1
  19. package/dist/interceptors/redirect.js +4 -33
  20. package/dist/interceptors/redirect.js.map +1 -1
  21. package/dist/interceptors/request-event.js +3 -30
  22. package/dist/interceptors/request-event.js.map +1 -1
  23. package/dist/interceptors/request-logger.js +1 -30
  24. package/dist/interceptors/request-logger.js.map +1 -1
  25. package/dist/interceptors/request-timing.js +3 -22
  26. package/dist/interceptors/request-timing.js.map +1 -1
  27. package/dist/interceptors/response-logger.js +2 -31
  28. package/dist/interceptors/response-logger.js.map +1 -1
  29. package/dist/interceptors/user-agent.js +2 -29
  30. package/dist/interceptors/user-agent.js.map +1 -1
  31. package/dist/interceptors/webex-tracking-id.js +5 -28
  32. package/dist/interceptors/webex-tracking-id.js.map +1 -1
  33. package/dist/interceptors/webex-user-agent.js +5 -38
  34. package/dist/interceptors/webex-user-agent.js.map +1 -1
  35. package/dist/lib/batcher.js +3 -51
  36. package/dist/lib/batcher.js.map +1 -1
  37. package/dist/lib/credentials/credentials.js +39 -119
  38. package/dist/lib/credentials/credentials.js.map +1 -1
  39. package/dist/lib/credentials/grant-errors.js +0 -49
  40. package/dist/lib/credentials/grant-errors.js.map +1 -1
  41. package/dist/lib/credentials/index.js +1 -13
  42. package/dist/lib/credentials/index.js.map +1 -1
  43. package/dist/lib/credentials/scope.js +1 -7
  44. package/dist/lib/credentials/scope.js.map +1 -1
  45. package/dist/lib/credentials/token-collection.js +1 -7
  46. package/dist/lib/credentials/token-collection.js.map +1 -1
  47. package/dist/lib/credentials/token.js +39 -118
  48. package/dist/lib/credentials/token.js.map +1 -1
  49. package/dist/lib/page.js +13 -26
  50. package/dist/lib/page.js.map +1 -1
  51. package/dist/lib/services/constants.js +0 -2
  52. package/dist/lib/services/constants.js.map +1 -1
  53. package/dist/lib/services/index.js +1 -28
  54. package/dist/lib/services/index.js.map +1 -1
  55. package/dist/lib/services/interceptors/server-error.js +2 -23
  56. package/dist/lib/services/interceptors/server-error.js.map +1 -1
  57. package/dist/lib/services/interceptors/service.js +12 -34
  58. package/dist/lib/services/interceptors/service.js.map +1 -1
  59. package/dist/lib/services/metrics.js +0 -2
  60. package/dist/lib/services/metrics.js.map +1 -1
  61. package/dist/lib/services/service-catalog.js +10 -90
  62. package/dist/lib/services/service-catalog.js.map +1 -1
  63. package/dist/lib/services/service-fed-ramp.js +0 -2
  64. package/dist/lib/services/service-fed-ramp.js.map +1 -1
  65. package/dist/lib/services/service-host.js +47 -62
  66. package/dist/lib/services/service-host.js.map +1 -1
  67. package/dist/lib/services/service-registry.js +78 -90
  68. package/dist/lib/services/service-registry.js.map +1 -1
  69. package/dist/lib/services/service-state.js +3 -15
  70. package/dist/lib/services/service-state.js.map +1 -1
  71. package/dist/lib/services/service-url.js +4 -25
  72. package/dist/lib/services/service-url.js.map +1 -1
  73. package/dist/lib/services/services.js +122 -238
  74. package/dist/lib/services/services.js.map +1 -1
  75. package/dist/lib/stateless-webex-plugin.js +5 -28
  76. package/dist/lib/stateless-webex-plugin.js.map +1 -1
  77. package/dist/lib/storage/decorators.js +19 -62
  78. package/dist/lib/storage/decorators.js.map +1 -1
  79. package/dist/lib/storage/errors.js +0 -23
  80. package/dist/lib/storage/errors.js.map +1 -1
  81. package/dist/lib/storage/index.js +2 -16
  82. package/dist/lib/storage/index.js.map +1 -1
  83. package/dist/lib/storage/make-webex-plugin-store.js +11 -41
  84. package/dist/lib/storage/make-webex-plugin-store.js.map +1 -1
  85. package/dist/lib/storage/make-webex-store.js +8 -30
  86. package/dist/lib/storage/make-webex-store.js.map +1 -1
  87. package/dist/lib/storage/memory-store-adapter.js +1 -19
  88. package/dist/lib/storage/memory-store-adapter.js.map +1 -1
  89. package/dist/lib/webex-core-plugin-mixin.js +9 -29
  90. package/dist/lib/webex-core-plugin-mixin.js.map +1 -1
  91. package/dist/lib/webex-http-error.js +1 -31
  92. package/dist/lib/webex-http-error.js.map +1 -1
  93. package/dist/lib/webex-internal-core-plugin-mixin.js +9 -29
  94. package/dist/lib/webex-internal-core-plugin-mixin.js.map +1 -1
  95. package/dist/lib/webex-plugin.js +6 -40
  96. package/dist/lib/webex-plugin.js.map +1 -1
  97. package/dist/plugins/logger.js +3 -17
  98. package/dist/plugins/logger.js.map +1 -1
  99. package/dist/webex-core.js +79 -203
  100. package/dist/webex-core.js.map +1 -1
  101. package/dist/webex-internal-core.js +0 -10
  102. package/dist/webex-internal-core.js.map +1 -1
  103. package/package.json +14 -14
  104. package/src/config.js +9 -11
  105. package/src/credentials-config.js +110 -72
  106. package/src/index.js +4 -14
  107. package/src/interceptors/auth.js +36 -37
  108. package/src/interceptors/default-options.js +0 -1
  109. package/src/interceptors/embargo.js +1 -1
  110. package/src/interceptors/payload-transformer.js +1 -2
  111. package/src/interceptors/rate-limit.js +8 -5
  112. package/src/interceptors/redirect.js +14 -8
  113. package/src/interceptors/request-event.js +4 -8
  114. package/src/interceptors/request-logger.js +8 -5
  115. package/src/interceptors/response-logger.js +11 -8
  116. package/src/interceptors/user-agent.js +1 -2
  117. package/src/interceptors/webex-user-agent.js +3 -9
  118. package/src/lib/batcher.js +70 -69
  119. package/src/lib/credentials/credentials.js +112 -122
  120. package/src/lib/credentials/grant-errors.js +6 -7
  121. package/src/lib/credentials/index.js +1 -4
  122. package/src/lib/credentials/scope.js +1 -4
  123. package/src/lib/credentials/token-collection.js +1 -1
  124. package/src/lib/credentials/token.js +86 -80
  125. package/src/lib/page.js +10 -11
  126. package/src/lib/services/constants.js +3 -13
  127. package/src/lib/services/index.js +2 -2
  128. package/src/lib/services/interceptors/server-error.js +12 -7
  129. package/src/lib/services/interceptors/service.js +6 -5
  130. package/src/lib/services/metrics.js +1 -1
  131. package/src/lib/services/service-catalog.js +110 -100
  132. package/src/lib/services/service-fed-ramp.js +1 -2
  133. package/src/lib/services/service-host.js +10 -17
  134. package/src/lib/services/service-registry.js +69 -96
  135. package/src/lib/services/service-state.js +4 -6
  136. package/src/lib/services/service-url.js +24 -23
  137. package/src/lib/services/services.js +260 -251
  138. package/src/lib/stateless-webex-plugin.js +4 -2
  139. package/src/lib/storage/decorators.js +68 -66
  140. package/src/lib/storage/index.js +4 -6
  141. package/src/lib/storage/make-webex-plugin-store.js +34 -21
  142. package/src/lib/storage/make-webex-store.js +6 -7
  143. package/src/lib/storage/memory-store-adapter.js +3 -3
  144. package/src/lib/webex-core-plugin-mixin.js +10 -7
  145. package/src/lib/webex-http-error.js +7 -8
  146. package/src/lib/webex-internal-core-plugin-mixin.js +9 -6
  147. package/src/lib/webex-plugin.js +41 -34
  148. package/src/plugins/logger.js +8 -3
  149. package/src/webex-core.js +185 -116
  150. package/src/webex-internal-core.js +15 -9
  151. package/test/integration/spec/credentials/credentials.js +26 -30
  152. package/test/integration/spec/credentials/token.js +36 -33
  153. package/test/integration/spec/services/service-catalog.js +177 -156
  154. package/test/integration/spec/services/services.js +313 -304
  155. package/test/integration/spec/webex-core.js +98 -86
  156. package/test/unit/spec/_setup.js +26 -18
  157. package/test/unit/spec/credentials/credentials.js +189 -154
  158. package/test/unit/spec/credentials/token.js +94 -76
  159. package/test/unit/spec/interceptors/auth.js +291 -243
  160. package/test/unit/spec/interceptors/default-options.js +36 -24
  161. package/test/unit/spec/interceptors/embargo.js +32 -27
  162. package/test/unit/spec/interceptors/network-timing.js +2 -2
  163. package/test/unit/spec/interceptors/payload-transformer.js +61 -52
  164. package/test/unit/spec/interceptors/rate-limit.js +104 -75
  165. package/test/unit/spec/interceptors/redirect.js +22 -20
  166. package/test/unit/spec/interceptors/request-timing.js +18 -22
  167. package/test/unit/spec/interceptors/user-agent.js +28 -16
  168. package/test/unit/spec/interceptors/webex-tracking-id.js +14 -8
  169. package/test/unit/spec/interceptors/webex-user-agent.js +83 -37
  170. package/test/unit/spec/lib/batcher.js +36 -32
  171. package/test/unit/spec/lib/page.js +36 -32
  172. package/test/unit/spec/lib/webex-plugin.js +1 -1
  173. package/test/unit/spec/services/interceptors/server-error.js +67 -90
  174. package/test/unit/spec/services/interceptors/service.js +17 -28
  175. package/test/unit/spec/services/service-catalog.js +19 -27
  176. package/test/unit/spec/services/service-host.js +29 -26
  177. package/test/unit/spec/services/service-registry.js +128 -170
  178. package/test/unit/spec/services/service-state.js +13 -22
  179. package/test/unit/spec/services/service-url.js +24 -43
  180. package/test/unit/spec/services/services.js +85 -41
  181. package/test/unit/spec/storage/persist.js +6 -9
  182. package/test/unit/spec/storage/wait-for-value.js +22 -21
  183. package/test/unit/spec/webex-core.js +78 -57
  184. package/test/unit/spec/webex-internal-core.js +56 -31
@@ -1,23 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.default = void 0;
12
-
13
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
14
-
15
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
16
-
17
11
  var _url = _interopRequireDefault(require("url"));
18
-
19
12
  var _constants = require("./constants");
20
-
21
13
  /**
22
14
  * The parameter transfer object for {@link ServiceHost#constructor}.
23
15
  *
@@ -29,7 +21,6 @@ var _constants = require("./constants");
29
21
  * @property {number} ServiceHostConstructorPTO.priority - The host's priority.
30
22
  * @property {string} ServiceHostConstructorPTO.uri - The host's uri.
31
23
  */
32
-
33
24
  /**
34
25
  * The parameter transfer object for {@link ServiceHost#polyGenerate}.
35
26
  *
@@ -38,7 +29,6 @@ var _constants = require("./constants");
38
29
  * @property {string} ServiceHostPolyGeneratePTO.name - The service name.
39
30
  * @property {string} ServiceHostPolyGeneratePTO.url - The service url.
40
31
  */
41
-
42
32
  /**
43
33
  * @class
44
34
  * @classdesc - Manages a single service host and its associated data.
@@ -55,8 +45,9 @@ var ServiceHost = /*#__PURE__*/function () {
55
45
  function ServiceHost(pto) {
56
46
  (0, _classCallCheck2.default)(this, ServiceHost);
57
47
  // Validate the parameter transfer object.
58
- ServiceHost.validate(pto); // Map the parameter transfer object to the class object.
48
+ ServiceHost.validate(pto);
59
49
 
50
+ // Map the parameter transfer object to the class object.
60
51
  /**
61
52
  * The catalog name that the {@link ServiceHost} is associated with.
62
53
  *
@@ -65,8 +56,8 @@ var ServiceHost = /*#__PURE__*/function () {
65
56
  * @public
66
57
  * @memberof ServiceHost
67
58
  */
68
-
69
59
  this.catalog = pto.catalog;
60
+
70
61
  /**
71
62
  * The default URI for the {@link ServiceHost}.
72
63
  *
@@ -75,8 +66,8 @@ var ServiceHost = /*#__PURE__*/function () {
75
66
  * @public
76
67
  * @memberof ServiceHost
77
68
  */
78
-
79
69
  this.default = pto.defaultUri;
70
+
80
71
  /**
81
72
  * The host group that the {@link ServiceHost} is associated with.
82
73
  *
@@ -85,8 +76,8 @@ var ServiceHost = /*#__PURE__*/function () {
85
76
  * @public
86
77
  * @memberof ServiceHost
87
78
  */
88
-
89
79
  this.hostGroup = pto.hostGroup;
80
+
90
81
  /**
91
82
  * The cluster ID of the {@link ServiceHost}.
92
83
  *
@@ -95,8 +86,8 @@ var ServiceHost = /*#__PURE__*/function () {
95
86
  * @public
96
87
  * @memberof ServiceHost
97
88
  */
98
-
99
89
  this.id = pto.id;
90
+
100
91
  /**
101
92
  * The priority value of the {@link ServiceHost}. The lower the number, the
102
93
  * higher the priority.
@@ -106,8 +97,8 @@ var ServiceHost = /*#__PURE__*/function () {
106
97
  * @public
107
98
  * @memberof ServiceHost
108
99
  */
109
-
110
100
  this.priority = pto.priority;
101
+
111
102
  /**
112
103
  * The host uri of the {@link ServiceHost}.
113
104
  *
@@ -116,9 +107,9 @@ var ServiceHost = /*#__PURE__*/function () {
116
107
  * @public
117
108
  * @memberof ServiceHost
118
109
  */
110
+ this.uri = pto.uri;
119
111
 
120
- this.uri = pto.uri; // Generate flags.
121
-
112
+ // Generate flags.
122
113
  /**
123
114
  * If the {@link ServiceHost} is marked as failed.
124
115
  *
@@ -127,8 +118,8 @@ var ServiceHost = /*#__PURE__*/function () {
127
118
  * @protected
128
119
  * @memberof ServiceHost
129
120
  */
130
-
131
121
  this.failed = false;
122
+
132
123
  /**
133
124
  * If the {@link ServiceHost} is marked as replaced.
134
125
  *
@@ -137,9 +128,9 @@ var ServiceHost = /*#__PURE__*/function () {
137
128
  * @protected
138
129
  * @memberof ServiceHost
139
130
  */
140
-
141
131
  this.replaced = false;
142
132
  }
133
+
143
134
  /**
144
135
  * If the {@link ServiceHost} is in an active state.
145
136
  *
@@ -147,14 +138,13 @@ var ServiceHost = /*#__PURE__*/function () {
147
138
  * @memberof ServiceHost
148
139
  * @type {boolean} - `true` if the service is active and usable.
149
140
  */
150
-
151
-
152
141
  (0, _createClass2.default)(ServiceHost, [{
153
142
  key: "active",
154
143
  get: function get() {
155
144
  // Validate that the `ServiceHost` was not marked as failed or replaced.
156
145
  return !this.failed && !this.replaced;
157
146
  }
147
+
158
148
  /**
159
149
  * If the host is local to the user's cluster.
160
150
  *
@@ -162,12 +152,12 @@ var ServiceHost = /*#__PURE__*/function () {
162
152
  * @memberof ServiceHost
163
153
  * @type {boolean} - If the host is local.
164
154
  */
165
-
166
155
  }, {
167
156
  key: "local",
168
157
  get: function get() {
169
158
  return this.default.includes(this.hostGroup);
170
159
  }
160
+
171
161
  /**
172
162
  * The service value.
173
163
  *
@@ -175,12 +165,12 @@ var ServiceHost = /*#__PURE__*/function () {
175
165
  * @memberof ServiceHost
176
166
  * @type {string} - The service value.
177
167
  */
178
-
179
168
  }, {
180
169
  key: "service",
181
170
  get: function get() {
182
171
  return this.id.split(':')[3];
183
172
  }
173
+
184
174
  /**
185
175
  * The formatted url for the host.
186
176
  *
@@ -188,18 +178,19 @@ var ServiceHost = /*#__PURE__*/function () {
188
178
  * @memberof ServiceHost
189
179
  * @type {string} - The service url.
190
180
  */
191
-
192
181
  }, {
193
182
  key: "url",
194
183
  get: function get() {
195
184
  // Generate a url object from the default url.
196
- var urlObj = _url.default.parse(this.default); // Format the host of the generated url object.
197
-
185
+ var urlObj = _url.default.parse(this.default);
198
186
 
199
- urlObj.host = "".concat(this.uri).concat(urlObj.port ? ":".concat(urlObj.port) : ''); // Assign the formatted url to this.
187
+ // Format the host of the generated url object.
188
+ urlObj.host = "".concat(this.uri).concat(urlObj.port ? ":".concat(urlObj.port) : '');
200
189
 
190
+ // Assign the formatted url to this.
201
191
  return _url.default.format(urlObj);
202
192
  }
193
+
203
194
  /**
204
195
  * Set one or more of the status properties of the class object.
205
196
  *
@@ -210,23 +201,20 @@ var ServiceHost = /*#__PURE__*/function () {
210
201
  * @property {boolean} [pto.replaced] - the replaced status to set.
211
202
  * @returns {this}
212
203
  */
213
-
214
204
  }, {
215
205
  key: "setStatus",
216
206
  value: function setStatus(_ref) {
217
207
  var failed = _ref.failed,
218
- replaced = _ref.replaced;
219
-
208
+ replaced = _ref.replaced;
220
209
  if (failed !== undefined) {
221
210
  this.failed = failed;
222
211
  }
223
-
224
212
  if (replaced !== undefined) {
225
213
  this.replaced = replaced;
226
214
  }
227
-
228
215
  return this;
229
216
  }
217
+
230
218
  /**
231
219
  * Generate a service host using only a catalog, name, and URL.
232
220
  *
@@ -236,13 +224,12 @@ var ServiceHost = /*#__PURE__*/function () {
236
224
  * @param {ServiceHostPolyGeneratePTO} pto
237
225
  * @returns {ServiceHost} - The generated service host.
238
226
  */
239
-
240
227
  }], [{
241
228
  key: "polyGenerate",
242
229
  value: function polyGenerate(_ref2) {
243
230
  var catalog = _ref2.catalog,
244
- name = _ref2.name,
245
- url = _ref2.url;
231
+ name = _ref2.name,
232
+ url = _ref2.url;
246
233
  return new ServiceHost({
247
234
  catalog: catalog,
248
235
  defaultUri: url,
@@ -252,6 +239,7 @@ var ServiceHost = /*#__PURE__*/function () {
252
239
  uri: _url.default.parse(url).host
253
240
  });
254
241
  }
242
+
255
243
  /**
256
244
  * Validate that a constructor parameter transfer object is valid.
257
245
  *
@@ -262,55 +250,52 @@ var ServiceHost = /*#__PURE__*/function () {
262
250
  * @throws - If the parameter transfer object is not valid.
263
251
  * @returns {undefined}
264
252
  */
265
-
266
253
  }, {
267
254
  key: "validate",
268
255
  value: function validate(_ref3) {
269
256
  var catalog = _ref3.catalog,
270
- defaultUri = _ref3.defaultUri,
271
- hostGroup = _ref3.hostGroup,
272
- id = _ref3.id,
273
- priority = _ref3.priority,
274
- uri = _ref3.uri;
275
-
257
+ defaultUri = _ref3.defaultUri,
258
+ hostGroup = _ref3.hostGroup,
259
+ id = _ref3.id,
260
+ priority = _ref3.priority,
261
+ uri = _ref3.uri;
276
262
  // Generate error-throwing method.
277
263
  var throwError = function throwError(msg) {
278
264
  throw new Error("service-host: invalid constructor parameters, ".concat(msg));
279
- }; // Validate the catalog property.
280
-
265
+ };
281
266
 
267
+ // Validate the catalog property.
282
268
  if (!_constants.SERVICE_CATALOGS.includes(catalog)) {
283
- throwError('\'catalog\' must be a string');
284
- } // Validate the `defaultUri` property.
285
-
269
+ throwError("'catalog' must be a string");
270
+ }
286
271
 
272
+ // Validate the `defaultUri` property.
287
273
  if (typeof defaultUri !== 'string') {
288
- throwError('\'defaultUri\' must be a string');
289
- } // Validate the `hostGroup` property.
290
-
274
+ throwError("'defaultUri' must be a string");
275
+ }
291
276
 
277
+ // Validate the `hostGroup` property.
292
278
  if (typeof hostGroup !== 'string') {
293
- throwError('\'hostGroup\' must be a string');
294
- } // Validate the `id` property.
295
-
279
+ throwError("'hostGroup' must be a string");
280
+ }
296
281
 
282
+ // Validate the `id` property.
297
283
  if (typeof id !== 'string' || id.split(':').length !== 4) {
298
- throwError('\'id\' must be a string that contains 3 \':\' characters');
299
- } // Validate the `priority` property.
300
-
284
+ throwError("'id' must be a string that contains 3 ':' characters");
285
+ }
301
286
 
287
+ // Validate the `priority` property.
302
288
  if (typeof priority !== 'number') {
303
- throwError('\'priority\' must be a number');
304
- } // Validate the `uri` property.
305
-
289
+ throwError("'priority' must be a number");
290
+ }
306
291
 
292
+ // Validate the `uri` property.
307
293
  if (typeof uri !== 'string') {
308
- throwError('\'uri\' must be a string');
294
+ throwError("'uri' must be a string");
309
295
  }
310
296
  }
311
297
  }]);
312
298
  return ServiceHost;
313
299
  }();
314
-
315
300
  exports.default = ServiceHost;
316
301
  //# sourceMappingURL=service-host.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ServiceHost","pto","validate","catalog","default","defaultUri","hostGroup","id","priority","uri","failed","replaced","includes","split","urlObj","Url","parse","host","port","format","undefined","name","url","throwError","msg","Error","SERVICE_CATALOGS","length"],"sources":["service-host.js"],"sourcesContent":["import Url from 'url';\n\nimport {SERVICE_CATALOGS} from './constants';\n\n/**\n * The parameter transfer object for {@link ServiceHost#constructor}.\n *\n * @typedef {Object} ServiceHostConstructorPTO\n * @property {string} ServiceHostConstructorPTO.catalog - The host's catalog.\n * @property {string} ServiceHostConstructorPTO.defaultUri - The host's default.\n * @property {string} ServiceHostConstructorPTO.hostGroup - The host's group.\n * @property {string} ServiceHostConstructorPTO.id - The host's clusterId.\n * @property {number} ServiceHostConstructorPTO.priority - The host's priority.\n * @property {string} ServiceHostConstructorPTO.uri - The host's uri.\n */\n\n/**\n * The parameter transfer object for {@link ServiceHost#polyGenerate}.\n *\n * @typedef {Object} ServiceHostPolyGeneratePTO\n * @property {string} ServiceHostPolyGeneratePTO.catalog - The target catalog.\n * @property {string} ServiceHostPolyGeneratePTO.name - The service name.\n * @property {string} ServiceHostPolyGeneratePTO.url - The service url.\n */\n\n/**\n * @class\n * @classdesc - Manages a single service host and its associated data.\n */\nexport default class ServiceHost {\n /**\n * Generate a new {@link ServiceHost}.\n *\n * @public\n * @constructor\n * @memberof ServiceHost\n * @param {ServiceHostConstructorPTO} pto\n */\n constructor(pto) {\n // Validate the parameter transfer object.\n ServiceHost.validate(pto);\n\n // Map the parameter transfer object to the class object.\n /**\n * The catalog name that the {@link ServiceHost} is associated with.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.catalog = pto.catalog;\n\n /**\n * The default URI for the {@link ServiceHost}.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.default = pto.defaultUri;\n\n /**\n * The host group that the {@link ServiceHost} is associated with.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.hostGroup = pto.hostGroup;\n\n /**\n * The cluster ID of the {@link ServiceHost}.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.id = pto.id;\n\n /**\n * The priority value of the {@link ServiceHost}. The lower the number, the\n * higher the priority.\n *\n * @instance\n * @type {number}\n * @public\n * @memberof ServiceHost\n */\n this.priority = pto.priority;\n\n /**\n * The host uri of the {@link ServiceHost}.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.uri = pto.uri;\n\n // Generate flags.\n /**\n * If the {@link ServiceHost} is marked as failed.\n *\n * @instance\n * @type {boolean}\n * @protected\n * @memberof ServiceHost\n */\n this.failed = false;\n\n /**\n * If the {@link ServiceHost} is marked as replaced.\n *\n * @instance\n * @type {boolean}\n * @protected\n * @memberof ServiceHost\n */\n this.replaced = false;\n }\n\n /**\n * If the {@link ServiceHost} is in an active state.\n *\n * @public\n * @memberof ServiceHost\n * @type {boolean} - `true` if the service is active and usable.\n */\n get active() {\n // Validate that the `ServiceHost` was not marked as failed or replaced.\n return (!this.failed && !this.replaced);\n }\n\n /**\n * If the host is local to the user's cluster.\n *\n * @public\n * @memberof ServiceHost\n * @type {boolean} - If the host is local.\n */\n get local() {\n return this.default.includes(this.hostGroup);\n }\n\n /**\n * The service value.\n *\n * @public\n * @memberof ServiceHost\n * @type {string} - The service value.\n */\n get service() {\n return this.id.split(':')[3];\n }\n\n /**\n * The formatted url for the host.\n *\n * @public\n * @memberof ServiceHost\n * @type {string} - The service url.\n */\n get url() {\n // Generate a url object from the default url.\n const urlObj = Url.parse(this.default);\n\n // Format the host of the generated url object.\n urlObj.host = `${this.uri}${urlObj.port ? `:${urlObj.port}` : ''}`;\n\n // Assign the formatted url to this.\n return Url.format(urlObj);\n }\n\n /**\n * Set one or more of the status properties of the class object.\n *\n * @public\n * @memberof ServiceHost\n * @param {Object} pto - The parameter transfer object.\n * @property {boolean} [pto.failed] - The failed status to set.\n * @property {boolean} [pto.replaced] - the replaced status to set.\n * @returns {this}\n */\n setStatus({failed, replaced}) {\n if (failed !== undefined) {\n this.failed = failed;\n }\n\n if (replaced !== undefined) {\n this.replaced = replaced;\n }\n\n return this;\n }\n\n /**\n * Generate a service host using only a catalog, name, and URL.\n *\n * @public\n * @static\n * @memberof ServiceHost\n * @param {ServiceHostPolyGeneratePTO} pto\n * @returns {ServiceHost} - The generated service host.\n */\n static polyGenerate({catalog, name, url}) {\n return new ServiceHost({\n catalog,\n defaultUri: url,\n hostGroup: Url.parse(url).host,\n id: (name) ? `poly-head:poly-group:poly-cluster:${name}` : undefined,\n priority: 1,\n uri: Url.parse(url).host\n });\n }\n\n /**\n * Validate that a constructor parameter transfer object is valid.\n *\n * @public\n * @static\n * @memberof ServiceHost\n * @param {ServiceHostConstructorPTO} pto\n * @throws - If the parameter transfer object is not valid.\n * @returns {undefined}\n */\n static validate({\n catalog,\n defaultUri,\n hostGroup,\n id,\n priority,\n uri\n }) {\n // Generate error-throwing method.\n const throwError = (msg) => {\n throw new Error(`service-host: invalid constructor parameters, ${msg}`);\n };\n\n // Validate the catalog property.\n if (!SERVICE_CATALOGS.includes(catalog)) {\n throwError('\\'catalog\\' must be a string');\n }\n\n // Validate the `defaultUri` property.\n if (typeof defaultUri !== 'string') {\n throwError('\\'defaultUri\\' must be a string');\n }\n\n // Validate the `hostGroup` property.\n if (typeof hostGroup !== 'string') {\n throwError('\\'hostGroup\\' must be a string');\n }\n\n // Validate the `id` property.\n if (typeof id !== 'string' || id.split(':').length !== 4) {\n throwError('\\'id\\' must be a string that contains 3 \\':\\' characters');\n }\n\n // Validate the `priority` property.\n if (typeof priority !== 'number') {\n throwError('\\'priority\\' must be a number');\n }\n\n // Validate the `uri` property.\n if (typeof uri !== 'string') {\n throwError('\\'uri\\' must be a string');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;IACqBA,W;EACnB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,qBAAYC,GAAZ,EAAiB;IAAA;IACf;IACAD,WAAW,CAACE,QAAZ,CAAqBD,GAArB,EAFe,CAIf;;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKE,OAAL,GAAeF,GAAG,CAACE,OAAnB;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKC,OAAL,GAAeH,GAAG,CAACI,UAAnB;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKC,SAAL,GAAiBL,GAAG,CAACK,SAArB;IAEA;AACJ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AoC;QAClCkB,UAAU,CAAC,iCAAD,CAAV;MACD,CAdA,CAgBD;;;MACA,IAAI,OAAOjB,SAAP,KAAqB,QAAzB,EAAmC;QACjCiB,UAAU,CAAC,gCAAD,CAAV;MACD,CAnBA,CAqBD;;;MACA,IAAI,OAAOhB,EAAP,KAAc,QAAd,IAA0BA,EAAE,CAACM,KAAH,CAAS,GAAT,EAAcc,MAAd,KAAyB,CAAvD,EAA0D;QACxDJ,UAAU,CAAC,0DAAD,CAAV;MACD,CAxBA,CA0BD;;;MACA,IAAI,OAAOf,QAAP,KAAoB,QAAxB,EAAkC;QAChCe,UAAU,CAAC,+BAAD,CAAV;MACD,CA7BA,CA+BD;;;MACA,IAAI,OAAOd,GAAP,KAAe,QAAnB,EAA6B;QAC3Bc,UAAU,CAAC,0BAAD,CAAV;MACD;IACF"}
1
+ {"version":3,"names":["ServiceHost","pto","validate","catalog","default","defaultUri","hostGroup","id","priority","uri","failed","replaced","includes","split","urlObj","Url","parse","host","port","format","undefined","name","url","throwError","msg","Error","SERVICE_CATALOGS","length"],"sources":["service-host.js"],"sourcesContent":["import Url from 'url';\n\nimport {SERVICE_CATALOGS} from './constants';\n\n/**\n * The parameter transfer object for {@link ServiceHost#constructor}.\n *\n * @typedef {Object} ServiceHostConstructorPTO\n * @property {string} ServiceHostConstructorPTO.catalog - The host's catalog.\n * @property {string} ServiceHostConstructorPTO.defaultUri - The host's default.\n * @property {string} ServiceHostConstructorPTO.hostGroup - The host's group.\n * @property {string} ServiceHostConstructorPTO.id - The host's clusterId.\n * @property {number} ServiceHostConstructorPTO.priority - The host's priority.\n * @property {string} ServiceHostConstructorPTO.uri - The host's uri.\n */\n\n/**\n * The parameter transfer object for {@link ServiceHost#polyGenerate}.\n *\n * @typedef {Object} ServiceHostPolyGeneratePTO\n * @property {string} ServiceHostPolyGeneratePTO.catalog - The target catalog.\n * @property {string} ServiceHostPolyGeneratePTO.name - The service name.\n * @property {string} ServiceHostPolyGeneratePTO.url - The service url.\n */\n\n/**\n * @class\n * @classdesc - Manages a single service host and its associated data.\n */\nexport default class ServiceHost {\n /**\n * Generate a new {@link ServiceHost}.\n *\n * @public\n * @constructor\n * @memberof ServiceHost\n * @param {ServiceHostConstructorPTO} pto\n */\n constructor(pto) {\n // Validate the parameter transfer object.\n ServiceHost.validate(pto);\n\n // Map the parameter transfer object to the class object.\n /**\n * The catalog name that the {@link ServiceHost} is associated with.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.catalog = pto.catalog;\n\n /**\n * The default URI for the {@link ServiceHost}.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.default = pto.defaultUri;\n\n /**\n * The host group that the {@link ServiceHost} is associated with.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.hostGroup = pto.hostGroup;\n\n /**\n * The cluster ID of the {@link ServiceHost}.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.id = pto.id;\n\n /**\n * The priority value of the {@link ServiceHost}. The lower the number, the\n * higher the priority.\n *\n * @instance\n * @type {number}\n * @public\n * @memberof ServiceHost\n */\n this.priority = pto.priority;\n\n /**\n * The host uri of the {@link ServiceHost}.\n *\n * @instance\n * @type {string}\n * @public\n * @memberof ServiceHost\n */\n this.uri = pto.uri;\n\n // Generate flags.\n /**\n * If the {@link ServiceHost} is marked as failed.\n *\n * @instance\n * @type {boolean}\n * @protected\n * @memberof ServiceHost\n */\n this.failed = false;\n\n /**\n * If the {@link ServiceHost} is marked as replaced.\n *\n * @instance\n * @type {boolean}\n * @protected\n * @memberof ServiceHost\n */\n this.replaced = false;\n }\n\n /**\n * If the {@link ServiceHost} is in an active state.\n *\n * @public\n * @memberof ServiceHost\n * @type {boolean} - `true` if the service is active and usable.\n */\n get active() {\n // Validate that the `ServiceHost` was not marked as failed or replaced.\n return !this.failed && !this.replaced;\n }\n\n /**\n * If the host is local to the user's cluster.\n *\n * @public\n * @memberof ServiceHost\n * @type {boolean} - If the host is local.\n */\n get local() {\n return this.default.includes(this.hostGroup);\n }\n\n /**\n * The service value.\n *\n * @public\n * @memberof ServiceHost\n * @type {string} - The service value.\n */\n get service() {\n return this.id.split(':')[3];\n }\n\n /**\n * The formatted url for the host.\n *\n * @public\n * @memberof ServiceHost\n * @type {string} - The service url.\n */\n get url() {\n // Generate a url object from the default url.\n const urlObj = Url.parse(this.default);\n\n // Format the host of the generated url object.\n urlObj.host = `${this.uri}${urlObj.port ? `:${urlObj.port}` : ''}`;\n\n // Assign the formatted url to this.\n return Url.format(urlObj);\n }\n\n /**\n * Set one or more of the status properties of the class object.\n *\n * @public\n * @memberof ServiceHost\n * @param {Object} pto - The parameter transfer object.\n * @property {boolean} [pto.failed] - The failed status to set.\n * @property {boolean} [pto.replaced] - the replaced status to set.\n * @returns {this}\n */\n setStatus({failed, replaced}) {\n if (failed !== undefined) {\n this.failed = failed;\n }\n\n if (replaced !== undefined) {\n this.replaced = replaced;\n }\n\n return this;\n }\n\n /**\n * Generate a service host using only a catalog, name, and URL.\n *\n * @public\n * @static\n * @memberof ServiceHost\n * @param {ServiceHostPolyGeneratePTO} pto\n * @returns {ServiceHost} - The generated service host.\n */\n static polyGenerate({catalog, name, url}) {\n return new ServiceHost({\n catalog,\n defaultUri: url,\n hostGroup: Url.parse(url).host,\n id: name ? `poly-head:poly-group:poly-cluster:${name}` : undefined,\n priority: 1,\n uri: Url.parse(url).host,\n });\n }\n\n /**\n * Validate that a constructor parameter transfer object is valid.\n *\n * @public\n * @static\n * @memberof ServiceHost\n * @param {ServiceHostConstructorPTO} pto\n * @throws - If the parameter transfer object is not valid.\n * @returns {undefined}\n */\n static validate({catalog, defaultUri, hostGroup, id, priority, uri}) {\n // Generate error-throwing method.\n const throwError = (msg) => {\n throw new Error(`service-host: invalid constructor parameters, ${msg}`);\n };\n\n // Validate the catalog property.\n if (!SERVICE_CATALOGS.includes(catalog)) {\n throwError(\"'catalog' must be a string\");\n }\n\n // Validate the `defaultUri` property.\n if (typeof defaultUri !== 'string') {\n throwError(\"'defaultUri' must be a string\");\n }\n\n // Validate the `hostGroup` property.\n if (typeof hostGroup !== 'string') {\n throwError(\"'hostGroup' must be a string\");\n }\n\n // Validate the `id` property.\n if (typeof id !== 'string' || id.split(':').length !== 4) {\n throwError(\"'id' must be a string that contains 3 ':' characters\");\n }\n\n // Validate the `priority` property.\n if (typeof priority !== 'number') {\n throwError(\"'priority' must be a number\");\n }\n\n // Validate the `uri` property.\n if (typeof uri !== 'string') {\n throwError(\"'uri' must be a string\");\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAAA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAHA,IAIqBA,WAAW;EAC9B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,qBAAYC,GAAG,EAAE;IAAA;IACf;IACAD,WAAW,CAACE,QAAQ,CAACD,GAAG,CAAC;;IAEzB;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACE,OAAO,GAAGF,GAAG,CAACE,OAAO;;IAE1B;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,OAAO,GAAGH,GAAG,CAACI,UAAU;;IAE7B;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAGL,GAAG,CAACK,SAAS;;IAE9B;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,EAAE,GAAGN,GAAG,CAACM,EAAE;;IAEhB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,QAAQ,GAAGP,GAAG,CAACO,QAAQ;;IAE5B;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,GAAG,GAAGR,GAAG,CAACQ,GAAG;;IAElB;IACA;AACJ;AACA;AACA;AACA;AAC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