@nsshunt/stsuxvue 1.0.91 → 1.0.93

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/dist/stsuxvue.cjs CHANGED
@@ -16029,145 +16029,6 @@ class ObservabilityPayloadTransformer {
16029
16029
  }
16030
16030
  }
16031
16031
  }
16032
- const byteToHex$1 = [];
16033
- for (let i = 0; i < 256; ++i) {
16034
- byteToHex$1.push((i + 256).toString(16).slice(1));
16035
- }
16036
- typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
16037
- const byteToHex = [];
16038
- for (let i = 0; i < 256; ++i) {
16039
- byteToHex.push((i + 256).toString(16).slice(1));
16040
- }
16041
- function unsafeStringify(arr, offset = 0) {
16042
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
16043
- }
16044
- let getRandomValues;
16045
- const rnds8 = new Uint8Array(16);
16046
- function rng() {
16047
- if (!getRandomValues) {
16048
- if (typeof crypto === "undefined" || !crypto.getRandomValues) {
16049
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
16050
- }
16051
- getRandomValues = crypto.getRandomValues.bind(crypto);
16052
- }
16053
- return getRandomValues(rnds8);
16054
- }
16055
- const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
16056
- const native = { randomUUID };
16057
- function _v4(options, buf, offset) {
16058
- options = options || {};
16059
- const rnds = options.random ?? options.rng?.() ?? rng();
16060
- if (rnds.length < 16) {
16061
- throw new Error("Random bytes length must be >= 16");
16062
- }
16063
- rnds[6] = rnds[6] & 15 | 64;
16064
- rnds[8] = rnds[8] & 63 | 128;
16065
- return unsafeStringify(rnds);
16066
- }
16067
- function v4(options, buf, offset) {
16068
- if (native.randomUUID && true && !options) {
16069
- return native.randomUUID();
16070
- }
16071
- return _v4(options);
16072
- }
16073
- const SOCKET_NAMESPACE = "stsinstrumentmanager/stsmonitor";
16074
- class SocketClientSubscriber extends SocketIoClient {
16075
- #options;
16076
- #id;
16077
- #currentSubscriptions = [];
16078
- subscriptions = {};
16079
- constructor(options) {
16080
- super("STSVueTilsTester");
16081
- this.#id = v4();
16082
- this.#options = options;
16083
- this.LogDebugMessage(chalk$1.cyan(`${this.logPrefix}Start()`));
16084
- const url = `${this.#options.instrumentManagerEndpoint}:${this.#options.instrumentManagerPort}/${SOCKET_NAMESPACE}/`;
16085
- this.LogDebugMessage(chalk$1.cyan(`${this.logPrefix}SetupSocket() url: [${url}]`));
16086
- this.WithAddress(url).WithLogger(this.logger ?? stsutils.defaultLogger).SetupSocket();
16087
- }
16088
- get id() {
16089
- return this.#id;
16090
- }
16091
- get logPrefix() {
16092
- if (this.#options) {
16093
- return `stsuxvue:ObservabilitySubscriberManager[${this.#options.consumeInstrumentationMode}]:`;
16094
- } else {
16095
- return `stsuxvue:ObservabilitySubscriberManager:`;
16096
- }
16097
- }
16098
- UpdateModelCursor = (subscriptions) => {
16099
- this.UnSubscribe(this.#currentSubscriptions);
16100
- this.#currentSubscriptions = subscriptions;
16101
- this.Subscribe(this.#currentSubscriptions);
16102
- };
16103
- Subscribe(subscriptions) {
16104
- subscriptions.map(async (subId) => {
16105
- try {
16106
- if (this.socket) {
16107
- this.LogDebugMessage(chalk$1.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16108
- this.socket.timeout(1e3).emit("subscribe", subId.subscriptionKey, (error, data) => {
16109
- if (error) {
16110
- this.LogErrorMessage(chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: [${error}], data: [${data}]`));
16111
- } else {
16112
- this.LogDebugMessage(chalk$1.green(`ObservabilitySocketIOSubscriber:Subscribe(): Response: [${JSON.stringify(data)}]`));
16113
- this.subscriptions[subId.subscriptionKey.id] = subId;
16114
- }
16115
- });
16116
- }
16117
- } catch (error) {
16118
- this.LogErrorMessage(chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
16119
- }
16120
- });
16121
- }
16122
- UnSubscribe(subscriptions) {
16123
- subscriptions.map(async (subId) => {
16124
- try {
16125
- if (this.socket) {
16126
- this.LogDebugMessage(chalk$1.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16127
- this.socket.timeout(1e3).emit("unsubscribe", subId.subscriptionKey, (error, data) => {
16128
- if (error) {
16129
- this.LogErrorMessage(chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error: [${error}], data: [${data}]`));
16130
- } else {
16131
- this.LogDebugMessage(chalk$1.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): Response: [${JSON.stringify(data)}]`));
16132
- delete this.subscriptions[subId.subscriptionKey.id];
16133
- }
16134
- });
16135
- }
16136
- } catch (error) {
16137
- this.LogErrorMessage(chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
16138
- }
16139
- });
16140
- }
16141
- SocketConnect(socket) {
16142
- this.LogDebugMessage(chalk$1.magenta(`${this.logPrefix}SocketConnect(): Socket ID: [${socket.id}]`));
16143
- this.UpdateModelCursor(this.#currentSubscriptions);
16144
- }
16145
- SocketError(error) {
16146
- this.LogErrorMessage(chalk$1.red(`${this.logPrefix}SocketError(): Error: [${error}]`));
16147
- }
16148
- SetupSocketEvents(socket) {
16149
- this.LogDebugMessage(chalk$1.magenta(`${this.logPrefix}SetupSocketEvents(): Socket ID: [${socket.id}]`));
16150
- if (this.socket) {
16151
- this.socket.on("subscriptionData", (data, cb) => {
16152
- this.LogDebugMessage(chalk$1.magenta(`${this.logPrefix}SetupSocketEvents(): on subscriptionData(): Socket ID: [${socket.id}]`));
16153
- const subId = data.subscriptionKey.id;
16154
- const currentSubscriptions = Object.keys(this.subscriptions).toString();
16155
- if (this.subscriptions[subId]) {
16156
- this.subscriptions[subId].cb(data);
16157
- cb(`stsuxvue:subscriptionData Response: [${JSON.stringify(data.subscriptionKey)}], Current Subscriptions: [${currentSubscriptions}]`);
16158
- } else {
16159
- cb(`stsuxvue:subscriptionData Response: No subscription found in subscriptions: [${JSON.stringify(data.subscriptionKey)}], Current Subscriptions: [${currentSubscriptions}]`);
16160
- }
16161
- });
16162
- }
16163
- }
16164
- SocketConnectError(error) {
16165
- this.LogErrorMessage(chalk$1.red(`${this.logPrefix}SocketConnectError(): Error: [${error}]`));
16166
- }
16167
- SocketDisconnect(reason) {
16168
- this.LogErrorMessage(chalk$1.red(`${this.logPrefix}SocketDisconnect(): reason: [${reason}]`));
16169
- }
16170
- }
16171
16032
  class RESTClientSubscriber {
16172
16033
  #socketSubscribeKeepAlive = {};
16173
16034
  #options;
@@ -16186,11 +16047,11 @@ class RESTClientSubscriber {
16186
16047
  async Subscribe(subscriptions) {
16187
16048
  subscriptions.map(async (subId) => {
16188
16049
  this.#RemoveKeepAlive(subId);
16189
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16050
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16190
16051
  try {
16191
16052
  this.#AddKeepAlive(subId);
16192
16053
  } catch (error) {
16193
- this.#LogErrorMessage(chalk$1.red(`RESTClientSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
16054
+ this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
16194
16055
  this.#RemoveKeepAlive(subId);
16195
16056
  }
16196
16057
  });
@@ -16198,17 +16059,17 @@ class RESTClientSubscriber {
16198
16059
  UnSubscribe(subscriptions) {
16199
16060
  subscriptions.map(async (subId) => {
16200
16061
  this.#RemoveKeepAlive(subId);
16201
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16062
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16202
16063
  });
16203
16064
  }
16204
16065
  UpdateModelCursor = (subscriptions) => {
16205
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:UnSubscribe(): UpdateModelCursor()`));
16066
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:UnSubscribe(): UpdateModelCursor()`));
16206
16067
  this.UnSubscribe(this.#currentSubscriptions);
16207
16068
  this.#currentSubscriptions = subscriptions;
16208
16069
  this.Subscribe(this.#currentSubscriptions);
16209
16070
  };
16210
16071
  async #InvokeRESTAPI(subscription) {
16211
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
16072
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
16212
16073
  const { subscriptionKey } = subscription;
16213
16074
  let url = "";
16214
16075
  switch (subscriptionKey.topic) {
@@ -16283,15 +16144,15 @@ class RESTClientSubscriber {
16283
16144
  let retVal;
16284
16145
  const start = performance.now();
16285
16146
  try {
16286
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): axios call: endPointUrl: [${endPointUrl}]`));
16147
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): axios call: endPointUrl: [${endPointUrl}]`));
16287
16148
  retVal = await axios(new stsutils.STSAxiosConfig(endPointUrl, "get").withDefaultHeaders().config);
16288
16149
  if (retVal) {
16289
16150
  if (retVal.data) {
16290
16151
  } else {
16291
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): no retVal.data`));
16152
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): no retVal.data`));
16292
16153
  }
16293
16154
  } else {
16294
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): no retVal`));
16155
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): no retVal`));
16295
16156
  }
16296
16157
  const end = performance.now();
16297
16158
  const diff = end - start;
@@ -16306,7 +16167,7 @@ class RESTClientSubscriber {
16306
16167
  }
16307
16168
  return retVal.data;
16308
16169
  } catch (error) {
16309
- this.#LogErrorMessage(chalk$1.red(`RESTClientSubscriber:#InvokeRESTAPI(): subscriptionKey: [${subscription.subscriptionKey.id}], Error: [${error}]`));
16170
+ this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:#InvokeRESTAPI(): subscriptionKey: [${subscription.subscriptionKey.id}], Error: [${error}]`));
16310
16171
  return null;
16311
16172
  }
16312
16173
  } else {
@@ -16315,20 +16176,20 @@ class RESTClientSubscriber {
16315
16176
  }
16316
16177
  #GetData = async (subscription) => {
16317
16178
  try {
16318
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#GetData(): subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
16179
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#GetData(): subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
16319
16180
  const retVal = await this.#InvokeRESTAPI(subscription);
16320
16181
  if (retVal) {
16321
16182
  const payload = {
16322
16183
  subscriptionKey: subscription.subscriptionKey,
16323
16184
  data: retVal
16324
16185
  };
16325
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#GetData(): data returned: subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}, retVal: [${JSON.stringify(retVal)}]`));
16186
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#GetData(): data returned: subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}, retVal: [${JSON.stringify(retVal)}]`));
16326
16187
  subscription.cb(payload);
16327
16188
  } else {
16328
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#GetData(): No data returned: subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
16189
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#GetData(): No data returned: subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
16329
16190
  }
16330
16191
  } catch (error) {
16331
- this.#LogErrorMessage(chalk$1.red(`RESTClientSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
16192
+ this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
16332
16193
  this.#RemoveKeepAlive(subscription);
16333
16194
  }
16334
16195
  };
@@ -16346,34 +16207,204 @@ class RESTClientSubscriber {
16346
16207
  }
16347
16208
  socketSubscribeKeepAlive.timeout = this.#SetupTimeout(socketSubscribeKeepAlive, subscription, timeoutDuration);
16348
16209
  } else {
16349
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber: Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
16210
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber: Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
16350
16211
  }
16351
16212
  } catch (error) {
16352
- this.#LogErrorMessage(chalk$1.red(`RESTClientSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
16213
+ this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
16353
16214
  this.#RemoveKeepAlive(subscription);
16354
16215
  }
16355
16216
  }, timeout);
16356
16217
  }
16357
16218
  #AddKeepAlive(subscription) {
16358
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#AddKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
16219
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#AddKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
16359
16220
  this.#RemoveKeepAlive(subscription);
16360
16221
  const socketSubscribeKeepAlive = {
16361
16222
  id: subscription.subscriptionKey.id
16362
16223
  };
16363
16224
  socketSubscribeKeepAlive.timeout = this.#SetupTimeout(socketSubscribeKeepAlive, subscription, this.#options.keepAlive ?? 1e3);
16364
16225
  this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id] = socketSubscribeKeepAlive;
16365
- this.#LogDebugMessage(chalk$1.yellow(`RESTClientSubscriber:#AddKeepAlive(): Getting Data: subscriptionKey: [${subscription.subscriptionKey.id}]`));
16226
+ this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#AddKeepAlive(): Getting Data: subscriptionKey: [${subscription.subscriptionKey.id}]`));
16366
16227
  this.#GetData(subscription);
16367
16228
  }
16368
16229
  #RemoveKeepAlive(subscription) {
16369
16230
  if (this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id]) {
16370
- this.#LogDebugMessage(chalk$1.gray(`RESTClientSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
16231
+ this.#LogDebugMessage(chalk.gray(`RESTClientSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
16371
16232
  clearTimeout(this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id].timeout);
16372
16233
  delete this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id].timeout;
16373
16234
  delete this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id];
16374
16235
  }
16375
16236
  }
16376
16237
  }
16238
+ const byteToHex$1 = [];
16239
+ for (let i = 0; i < 256; ++i) {
16240
+ byteToHex$1.push((i + 256).toString(16).slice(1));
16241
+ }
16242
+ function unsafeStringify$1(arr, offset = 0) {
16243
+ return (byteToHex$1[arr[offset + 0]] + byteToHex$1[arr[offset + 1]] + byteToHex$1[arr[offset + 2]] + byteToHex$1[arr[offset + 3]] + "-" + byteToHex$1[arr[offset + 4]] + byteToHex$1[arr[offset + 5]] + "-" + byteToHex$1[arr[offset + 6]] + byteToHex$1[arr[offset + 7]] + "-" + byteToHex$1[arr[offset + 8]] + byteToHex$1[arr[offset + 9]] + "-" + byteToHex$1[arr[offset + 10]] + byteToHex$1[arr[offset + 11]] + byteToHex$1[arr[offset + 12]] + byteToHex$1[arr[offset + 13]] + byteToHex$1[arr[offset + 14]] + byteToHex$1[arr[offset + 15]]).toLowerCase();
16244
+ }
16245
+ let getRandomValues$1;
16246
+ const rnds8$1 = new Uint8Array(16);
16247
+ function rng$1() {
16248
+ if (!getRandomValues$1) {
16249
+ if (typeof crypto === "undefined" || !crypto.getRandomValues) {
16250
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
16251
+ }
16252
+ getRandomValues$1 = crypto.getRandomValues.bind(crypto);
16253
+ }
16254
+ return getRandomValues$1(rnds8$1);
16255
+ }
16256
+ const randomUUID$1 = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
16257
+ const native$1 = { randomUUID: randomUUID$1 };
16258
+ function _v4$1(options, buf, offset) {
16259
+ options = options || {};
16260
+ const rnds = options.random ?? options.rng?.() ?? rng$1();
16261
+ if (rnds.length < 16) {
16262
+ throw new Error("Random bytes length must be >= 16");
16263
+ }
16264
+ rnds[6] = rnds[6] & 15 | 64;
16265
+ rnds[8] = rnds[8] & 63 | 128;
16266
+ return unsafeStringify$1(rnds);
16267
+ }
16268
+ function v4$1(options, buf, offset) {
16269
+ if (native$1.randomUUID && true && !options) {
16270
+ return native$1.randomUUID();
16271
+ }
16272
+ return _v4$1(options);
16273
+ }
16274
+ const SOCKET_NAMESPACE = "stsinstrumentmanager/stsmonitor";
16275
+ class SocketClientSubscriber extends SocketIoClient {
16276
+ #options;
16277
+ #id;
16278
+ #currentSubscriptions = [];
16279
+ subscriptions = {};
16280
+ constructor(options) {
16281
+ super("STSVueTilsTester");
16282
+ this.#id = v4$1();
16283
+ this.#options = options;
16284
+ this.LogDebugMessage(chalk.cyan(`${this.logPrefix}Start()`));
16285
+ const url = `${this.#options.instrumentManagerEndpoint}:${this.#options.instrumentManagerPort}/${SOCKET_NAMESPACE}/`;
16286
+ this.LogDebugMessage(chalk.cyan(`${this.logPrefix}SetupSocket() url: [${url}]`));
16287
+ this.WithAddress(url).WithLogger(this.logger ?? stsutils.defaultLogger).SetupSocket();
16288
+ }
16289
+ get id() {
16290
+ return this.#id;
16291
+ }
16292
+ get logPrefix() {
16293
+ if (this.#options) {
16294
+ return `stsuxvue:ObservabilitySubscriberManager[${this.#options.consumeInstrumentationMode}]:`;
16295
+ } else {
16296
+ return `stsuxvue:ObservabilitySubscriberManager:`;
16297
+ }
16298
+ }
16299
+ UpdateModelCursor = (subscriptions) => {
16300
+ this.UnSubscribe(this.#currentSubscriptions);
16301
+ this.#currentSubscriptions = subscriptions;
16302
+ this.Subscribe(this.#currentSubscriptions);
16303
+ };
16304
+ Subscribe(subscriptions) {
16305
+ subscriptions.map(async (subId) => {
16306
+ try {
16307
+ if (this.socket) {
16308
+ this.LogDebugMessage(chalk.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16309
+ this.socket.timeout(1e3).emit("subscribe", subId.subscriptionKey, (error, data) => {
16310
+ if (error) {
16311
+ this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: [${error}], data: [${data}]`));
16312
+ } else {
16313
+ this.LogDebugMessage(chalk.green(`ObservabilitySocketIOSubscriber:Subscribe(): Response: [${JSON.stringify(data)}]`));
16314
+ this.subscriptions[subId.subscriptionKey.id] = subId;
16315
+ }
16316
+ });
16317
+ }
16318
+ } catch (error) {
16319
+ this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
16320
+ }
16321
+ });
16322
+ }
16323
+ UnSubscribe(subscriptions) {
16324
+ subscriptions.map(async (subId) => {
16325
+ try {
16326
+ if (this.socket) {
16327
+ this.LogDebugMessage(chalk.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
16328
+ this.socket.timeout(1e3).emit("unsubscribe", subId.subscriptionKey, (error, data) => {
16329
+ if (error) {
16330
+ this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error: [${error}], data: [${data}]`));
16331
+ } else {
16332
+ this.LogDebugMessage(chalk.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): Response: [${JSON.stringify(data)}]`));
16333
+ delete this.subscriptions[subId.subscriptionKey.id];
16334
+ }
16335
+ });
16336
+ }
16337
+ } catch (error) {
16338
+ this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
16339
+ }
16340
+ });
16341
+ }
16342
+ SocketConnect(socket) {
16343
+ this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SocketConnect(): Socket ID: [${socket.id}]`));
16344
+ this.UpdateModelCursor(this.#currentSubscriptions);
16345
+ }
16346
+ SocketError(error) {
16347
+ this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketError(): Error: [${error}]`));
16348
+ }
16349
+ SetupSocketEvents(socket) {
16350
+ this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SetupSocketEvents(): Socket ID: [${socket.id}]`));
16351
+ if (this.socket) {
16352
+ this.socket.on("subscriptionData", (data, cb) => {
16353
+ this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SetupSocketEvents(): on subscriptionData(): Socket ID: [${socket.id}]`));
16354
+ const subId = data.subscriptionKey.id;
16355
+ const currentSubscriptions = Object.keys(this.subscriptions).toString();
16356
+ if (this.subscriptions[subId]) {
16357
+ this.subscriptions[subId].cb(data);
16358
+ cb(`stsuxvue:subscriptionData Response: [${JSON.stringify(data.subscriptionKey)}], Current Subscriptions: [${currentSubscriptions}]`);
16359
+ } else {
16360
+ cb(`stsuxvue:subscriptionData Response: No subscription found in subscriptions: [${JSON.stringify(data.subscriptionKey)}], Current Subscriptions: [${currentSubscriptions}]`);
16361
+ }
16362
+ });
16363
+ }
16364
+ }
16365
+ SocketConnectError(error) {
16366
+ this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketConnectError(): Error: [${error}]`));
16367
+ }
16368
+ SocketDisconnect(reason) {
16369
+ this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketDisconnect(): reason: [${reason}]`));
16370
+ }
16371
+ }
16372
+ const byteToHex = [];
16373
+ for (let i = 0; i < 256; ++i) {
16374
+ byteToHex.push((i + 256).toString(16).slice(1));
16375
+ }
16376
+ function unsafeStringify(arr, offset = 0) {
16377
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
16378
+ }
16379
+ let getRandomValues;
16380
+ const rnds8 = new Uint8Array(16);
16381
+ function rng() {
16382
+ if (!getRandomValues) {
16383
+ if (typeof crypto === "undefined" || !crypto.getRandomValues) {
16384
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
16385
+ }
16386
+ getRandomValues = crypto.getRandomValues.bind(crypto);
16387
+ }
16388
+ return getRandomValues(rnds8);
16389
+ }
16390
+ const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
16391
+ const native = { randomUUID };
16392
+ function _v4(options, buf, offset) {
16393
+ options = options || {};
16394
+ const rnds = options.random ?? options.rng?.() ?? rng();
16395
+ if (rnds.length < 16) {
16396
+ throw new Error("Random bytes length must be >= 16");
16397
+ }
16398
+ rnds[6] = rnds[6] & 15 | 64;
16399
+ rnds[8] = rnds[8] & 63 | 128;
16400
+ return unsafeStringify(rnds);
16401
+ }
16402
+ function v4(options, buf, offset) {
16403
+ if (native.randomUUID && true && !options) {
16404
+ return native.randomUUID();
16405
+ }
16406
+ return _v4(options);
16407
+ }
16377
16408
  const _hoisted_1$1 = { class: "d-flex flex-wrap justify-space-between" };
16378
16409
  const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
16379
16410
  __name: "UXModelNavigator",