@mindignited/continuum-client 2.14.6 → 2.14.8
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/continuum.cjs +2 -2
- package/dist/continuum.cjs.map +1 -1
- package/dist/continuum.js +129 -127
- package/dist/continuum.js.map +1 -1
- package/package.json +16 -17
package/dist/continuum.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RxStomp as
|
|
2
|
-
import { ReconnectionTimeMode as
|
|
1
|
+
import { RxStomp as M } from "@stomp/rx-stomp";
|
|
2
|
+
import { ReconnectionTimeMode as k } from "@stomp/stompjs";
|
|
3
3
|
import { v4 as S } from "uuid";
|
|
4
|
-
import
|
|
5
|
-
import b, { propagation as
|
|
6
|
-
import { Subject as A, firstValueFrom as
|
|
4
|
+
import B from "debug";
|
|
5
|
+
import b, { propagation as q, context as F, SpanKind as Y, SpanStatusCode as $ } from "@opentelemetry/api";
|
|
6
|
+
import { Subject as A, firstValueFrom as U, Observable as V, throwError as j } from "rxjs";
|
|
7
7
|
import { map as R, multicast as J, filter as X, first as W } from "rxjs/operators";
|
|
8
|
-
import { Optional as
|
|
8
|
+
import { Optional as N } from "typescript-optional";
|
|
9
9
|
import "reflect-metadata";
|
|
10
10
|
import { ATTR_SERVER_ADDRESS as G, ATTR_SERVER_PORT as K } from "@opentelemetry/semantic-conventions";
|
|
11
11
|
class Le {
|
|
@@ -53,7 +53,7 @@ class z {
|
|
|
53
53
|
JITTER_MAX = 5e3;
|
|
54
54
|
connectionAttempts = 0;
|
|
55
55
|
initialConnectionSuccessful = !1;
|
|
56
|
-
debugLogger =
|
|
56
|
+
debugLogger = B("continuum:stomp");
|
|
57
57
|
replyToId = S();
|
|
58
58
|
replyToCri = o.SERVICE_DESTINATION_PREFIX + this.replyToId + ":" + S() + "@continuum.js.EventBus/replyHandler";
|
|
59
59
|
deactivationHandler = null;
|
|
@@ -84,12 +84,12 @@ class z {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
this.connectionAttempts = 0, this.initialConnectionSuccessful = !1, this.lastWebsocketError = null, this.maxConnectionAttemptsReached = !1;
|
|
87
|
-
const
|
|
88
|
-
this.rxStomp = new
|
|
89
|
-
let
|
|
87
|
+
const i = "ws" + (e.useSSL ? "s" : "") + "://" + e.host + (e.port ? ":" + e.port : "") + "/v1";
|
|
88
|
+
this.rxStomp = new M();
|
|
89
|
+
let n = typeof e.connectHeaders != "function" && e.connectHeaders != null ? e.connectHeaders : {};
|
|
90
90
|
const c = {
|
|
91
|
-
brokerURL:
|
|
92
|
-
connectHeaders:
|
|
91
|
+
brokerURL: i,
|
|
92
|
+
connectHeaders: n,
|
|
93
93
|
heartbeatIncoming: 12e4,
|
|
94
94
|
heartbeatOutgoing: 3e4,
|
|
95
95
|
reconnectDelay: this.INITIAL_RECONNECT_DELAY,
|
|
@@ -97,9 +97,9 @@ class z {
|
|
|
97
97
|
if (typeof e.connectHeaders == "function") {
|
|
98
98
|
const u = await e.connectHeaders();
|
|
99
99
|
for (const l in u)
|
|
100
|
-
|
|
100
|
+
n[l] = u[l];
|
|
101
101
|
}
|
|
102
|
-
if (e.disableStickySession && (
|
|
102
|
+
if (e.disableStickySession && (n[o.DISABLE_STICKY_SESSION_HEADER] = "true"), n[o.REPLY_TO_ID_HEADER] ? this.replyToId = n[o.REPLY_TO_ID_HEADER] : n[o.REPLY_TO_ID_HEADER] = this.replyToId, e?.maxConnectionAttempts)
|
|
103
103
|
if (this.connectionAttempts++, this.connectionAttempts > e.maxConnectionAttempts) {
|
|
104
104
|
if (this.maxConnectionAttemptsReached = !0, await this.deactivate(), !this.initialConnectionSuccessful) {
|
|
105
105
|
let u = this.lastWebsocketError?.message ? this.lastWebsocketError?.message : "UNKNOWN";
|
|
@@ -113,7 +113,7 @@ class z {
|
|
|
113
113
|
};
|
|
114
114
|
this.debugLogger.enabled && (c.debug = (u) => {
|
|
115
115
|
this.debugLogger(u);
|
|
116
|
-
}), this.rxStomp.configure(c), this.rxStomp.stompClient.maxReconnectDelay = this.MAX_RECONNECT_DELAY, this.rxStomp.stompClient.reconnectTimeMode =
|
|
116
|
+
}), this.rxStomp.configure(c), this.rxStomp.stompClient.maxReconnectDelay = this.MAX_RECONNECT_DELAY, this.rxStomp.stompClient.reconnectTimeMode = k.EXPONENTIAL, this.rxStomp.webSocketErrors$.subscribe((u) => {
|
|
117
117
|
this.lastWebsocketError = u;
|
|
118
118
|
});
|
|
119
119
|
const a = this.rxStomp.connected$.subscribe(() => {
|
|
@@ -128,15 +128,15 @@ class z {
|
|
|
128
128
|
const d = JSON.parse(l);
|
|
129
129
|
if (e.disableStickySession)
|
|
130
130
|
if (typeof e.connectHeaders == "function") {
|
|
131
|
-
for (let v in
|
|
132
|
-
delete
|
|
131
|
+
for (let v in n)
|
|
132
|
+
delete n[v];
|
|
133
133
|
this.initialConnectionSuccessful || t(d);
|
|
134
134
|
} else typeof e.connectHeaders == "object" && (p.unsubscribe(), t(d));
|
|
135
135
|
else if (p.unsubscribe(), d.sessionId != null && d.replyToId != null) {
|
|
136
136
|
if (e.connectHeaders != null)
|
|
137
|
-
for (let v in
|
|
138
|
-
delete
|
|
139
|
-
|
|
137
|
+
for (let v in n)
|
|
138
|
+
delete n[v];
|
|
139
|
+
n[o.SESSION_HEADER] = d.sessionId, t(d);
|
|
140
140
|
} else
|
|
141
141
|
r("Server did not return proper data for successful login");
|
|
142
142
|
} else
|
|
@@ -163,7 +163,7 @@ class g {
|
|
|
163
163
|
headers;
|
|
164
164
|
data;
|
|
165
165
|
constructor(e, t, r) {
|
|
166
|
-
this.cri = e, t !== void 0 ? this.headers = t : this.headers = /* @__PURE__ */ new Map(), this.data =
|
|
166
|
+
this.cri = e, t !== void 0 ? this.headers = t : this.headers = /* @__PURE__ */ new Map(), this.data = N.ofNullable(r);
|
|
167
167
|
}
|
|
168
168
|
getHeader(e) {
|
|
169
169
|
return this.headers.get(e);
|
|
@@ -179,7 +179,7 @@ class g {
|
|
|
179
179
|
}
|
|
180
180
|
setDataString(e) {
|
|
181
181
|
const t = new TextEncoder().encode(e);
|
|
182
|
-
this.data =
|
|
182
|
+
this.data = N.ofNonNull(t);
|
|
183
183
|
}
|
|
184
184
|
getDataString() {
|
|
185
185
|
let e = "";
|
|
@@ -224,10 +224,10 @@ class Z {
|
|
|
224
224
|
send(e) {
|
|
225
225
|
if (this.stompConnectionManager.rxStomp) {
|
|
226
226
|
const t = {};
|
|
227
|
-
for (const [
|
|
228
|
-
t[
|
|
227
|
+
for (const [i, n] of e.headers.entries())
|
|
228
|
+
t[i] = n;
|
|
229
229
|
const r = {};
|
|
230
|
-
|
|
230
|
+
q.inject(F.active(), r), r.traceparent && (t[o.TRACEPARENT_HEADER] = r.traceparent), r.tracestate && (t[o.TRACESTATE_HEADER] = r.tracestate), this.stompConnectionManager.rxStomp.publish({
|
|
231
231
|
destination: e.cri,
|
|
232
232
|
headers: t,
|
|
233
233
|
binaryBody: e.data.orUndefined()
|
|
@@ -236,20 +236,20 @@ class Z {
|
|
|
236
236
|
throw this.createSendUnavailableError();
|
|
237
237
|
}
|
|
238
238
|
request(e) {
|
|
239
|
-
return
|
|
239
|
+
return U(this.requestStream(e, !1));
|
|
240
240
|
}
|
|
241
241
|
requestStream(e, t = !0) {
|
|
242
|
-
return this.stompConnectionManager?.rxStomp ? new
|
|
242
|
+
return this.stompConnectionManager?.rxStomp ? new V((r) => {
|
|
243
243
|
this.requestRepliesObservable == null && (this.requestRepliesSubject = new A(), this.requestRepliesObservable = this._observe(this.replyToCri).pipe(J(this.requestRepliesSubject)), this.requestRepliesSubscription = this.requestRepliesObservable.connect());
|
|
244
|
-
let
|
|
245
|
-
const
|
|
244
|
+
let i = !1;
|
|
245
|
+
const n = S(), c = this.requestRepliesObservable.pipe(X((a) => a.headers.get(o.CORRELATION_ID_HEADER) === n)).subscribe({
|
|
246
246
|
next(a) {
|
|
247
247
|
if (a.hasHeader(o.CONTROL_HEADER))
|
|
248
248
|
if (a.headers.get(o.CONTROL_HEADER) === "complete")
|
|
249
|
-
|
|
249
|
+
i = !0, r.complete();
|
|
250
250
|
else
|
|
251
251
|
throw new Error("Control Header " + a.headers.get(o.CONTROL_HEADER) + " is not supported");
|
|
252
|
-
else a.hasHeader(o.ERROR_HEADER) ? (
|
|
252
|
+
else a.hasHeader(o.ERROR_HEADER) ? (i = !0, r.error(new Error(a.getHeader(o.ERROR_HEADER)))) : r.next(a);
|
|
253
253
|
},
|
|
254
254
|
error(a) {
|
|
255
255
|
r.error(a);
|
|
@@ -258,13 +258,13 @@ class Z {
|
|
|
258
258
|
r.complete();
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
|
-
return r.add(c), e.setHeader(o.REPLY_TO_HEADER, this.replyToCri), e.setHeader(o.CORRELATION_ID_HEADER,
|
|
262
|
-
if (t && !
|
|
261
|
+
return r.add(c), e.setHeader(o.REPLY_TO_HEADER, this.replyToCri), e.setHeader(o.CORRELATION_ID_HEADER, n), this.send(e), () => {
|
|
262
|
+
if (t && !i) {
|
|
263
263
|
const a = new g(e.cri);
|
|
264
|
-
a.setHeader(o.CONTROL_HEADER, o.CONTROL_VALUE_CANCEL), a.setHeader(o.CORRELATION_ID_HEADER,
|
|
264
|
+
a.setHeader(o.CONTROL_HEADER, o.CONTROL_VALUE_CANCEL), a.setHeader(o.CORRELATION_ID_HEADER, n), this.send(a);
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
|
-
}) :
|
|
267
|
+
}) : j(() => this.createSendUnavailableError());
|
|
268
268
|
}
|
|
269
269
|
observe(e) {
|
|
270
270
|
return this._observe(e);
|
|
@@ -286,13 +286,15 @@ class Z {
|
|
|
286
286
|
* @return the cold {@link Observable<IEvent>} for the given destination
|
|
287
287
|
*/
|
|
288
288
|
_observe(e) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
289
|
+
if (this.stompConnectionManager?.rxStomp)
|
|
290
|
+
return this.stompConnectionManager.rxStomp.watch(e).pipe(R((t) => {
|
|
291
|
+
const r = /* @__PURE__ */ new Map();
|
|
292
|
+
let i = "";
|
|
293
|
+
for (const n of Object.keys(t.headers))
|
|
294
|
+
n === "destination" ? i = t.headers[n] : r.set(n, t.headers[n]);
|
|
295
|
+
return new g(i, r, t.binaryBody);
|
|
296
|
+
}));
|
|
297
|
+
throw this.createSendUnavailableError();
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
class E {
|
|
@@ -310,8 +312,8 @@ class E {
|
|
|
310
312
|
const r = E.parseRaw(t);
|
|
311
313
|
this._scheme = r.scheme, this._scope = r.scope, this._resourceName = r.resourceName, this._path = r.path, this._version = r.version, this._raw = t;
|
|
312
314
|
} else if (e.length === 5) {
|
|
313
|
-
const [t, r,
|
|
314
|
-
this._scheme = t, this._scope = r, this._resourceName =
|
|
315
|
+
const [t, r, i, n, c] = e;
|
|
316
|
+
this._scheme = t, this._scope = r, this._resourceName = i, this._path = n, this._version = c, this._raw = E.buildRaw(t, r, i, n, c);
|
|
315
317
|
} else
|
|
316
318
|
throw new Error("Invalid constructor arguments for DefaultCRI");
|
|
317
319
|
if (!this._scheme || !this._resourceName)
|
|
@@ -363,22 +365,22 @@ class E {
|
|
|
363
365
|
const t = /^([^:]+):\/\/(?:([^@]+)@)?([^\/#]+)(\/[^#]*)?(?:#(.+))?$/, r = e.match(t);
|
|
364
366
|
if (!r)
|
|
365
367
|
throw new Error(`Invalid CRI format: ${e}`);
|
|
366
|
-
const [,
|
|
368
|
+
const [, i, n, c, a, h] = r;
|
|
367
369
|
return {
|
|
368
|
-
scheme:
|
|
369
|
-
scope:
|
|
370
|
+
scheme: i,
|
|
371
|
+
scope: n || null,
|
|
370
372
|
resourceName: c,
|
|
371
373
|
path: a ? a.substring(1) : null,
|
|
372
374
|
version: h || null
|
|
373
375
|
};
|
|
374
376
|
}
|
|
375
377
|
// Helper to build a raw CRI string
|
|
376
|
-
static buildRaw(e, t, r,
|
|
378
|
+
static buildRaw(e, t, r, i, n) {
|
|
377
379
|
let c = `${e}://`;
|
|
378
|
-
return t && (c += `${t}@`), c += r,
|
|
380
|
+
return t && (c += `${t}@`), c += r, i && (c += `/${i}`), n && (c += `#${n}`), c;
|
|
379
381
|
}
|
|
380
382
|
}
|
|
381
|
-
function
|
|
383
|
+
function C(...s) {
|
|
382
384
|
if (s.length === 1) return new E(s[0]);
|
|
383
385
|
if (s.length === 2) return new E(s[0], null, s[1], null, null);
|
|
384
386
|
if (s.length === 3) return new E(s[0], s[1], s[2], null, null);
|
|
@@ -398,25 +400,25 @@ class Q {
|
|
|
398
400
|
return t != null && t !== "" && t === "application/json";
|
|
399
401
|
}
|
|
400
402
|
}
|
|
401
|
-
class
|
|
403
|
+
class I {
|
|
402
404
|
static createReplyEvent(e, t, r) {
|
|
403
405
|
if (!e)
|
|
404
406
|
throw new Error("incomingHeaders cannot be null");
|
|
405
|
-
const
|
|
406
|
-
if (!
|
|
407
|
+
const i = e.get(o.REPLY_TO_HEADER);
|
|
408
|
+
if (!i || i.trim() === "")
|
|
407
409
|
throw new Error("No reply-to header found, cannot create outgoing message");
|
|
408
|
-
const
|
|
410
|
+
const n = /* @__PURE__ */ new Map();
|
|
409
411
|
for (const [c, a] of e)
|
|
410
|
-
c.startsWith("__") &&
|
|
412
|
+
c.startsWith("__") && n.set(c, a);
|
|
411
413
|
if (t)
|
|
412
414
|
for (const [c, a] of t)
|
|
413
|
-
|
|
414
|
-
return new g(
|
|
415
|
+
n.set(c, a);
|
|
416
|
+
return new g(i, n, r || void 0);
|
|
415
417
|
}
|
|
416
418
|
}
|
|
417
419
|
class ee {
|
|
418
420
|
convert(e, t) {
|
|
419
|
-
return
|
|
421
|
+
return I.createReplyEvent(
|
|
420
422
|
e,
|
|
421
423
|
/* @__PURE__ */ new Map([[o.CONTENT_TYPE_HEADER, "application/json"]]),
|
|
422
424
|
new TextEncoder().encode(JSON.stringify(t))
|
|
@@ -460,7 +462,7 @@ class re {
|
|
|
460
462
|
* @return the cri for this {@link ServiceIdentifier}
|
|
461
463
|
*/
|
|
462
464
|
cri() {
|
|
463
|
-
return this._cri == null && (this._cri =
|
|
465
|
+
return this._cri == null && (this._cri = C(
|
|
464
466
|
o.SERVICE_DESTINATION_SCHEME,
|
|
465
467
|
// scheme
|
|
466
468
|
this.scope || null,
|
|
@@ -474,15 +476,15 @@ class re {
|
|
|
474
476
|
)), this._cri;
|
|
475
477
|
}
|
|
476
478
|
}
|
|
477
|
-
const
|
|
479
|
+
const O = Symbol("scope"), P = Symbol("version"), T = Symbol("context");
|
|
478
480
|
function ke(s, e, t) {
|
|
479
|
-
Reflect.defineMetadata(
|
|
481
|
+
Reflect.defineMetadata(O, e, s);
|
|
480
482
|
}
|
|
481
483
|
function Be(s) {
|
|
482
484
|
if (!/^\d+\.\d+\.\d+(-[a-zA-Z0-9]+)?$/.test(s))
|
|
483
485
|
throw new Error(`Invalid semantic version: ${s}. Must follow X.Y.Z[-optional] format.`);
|
|
484
486
|
return function(e) {
|
|
485
|
-
Reflect.defineMetadata(
|
|
487
|
+
Reflect.defineMetadata(P, s, e);
|
|
486
488
|
};
|
|
487
489
|
}
|
|
488
490
|
function qe() {
|
|
@@ -493,15 +495,15 @@ function qe() {
|
|
|
493
495
|
}
|
|
494
496
|
function Fe(s, e) {
|
|
495
497
|
return function(t) {
|
|
496
|
-
const r = t,
|
|
497
|
-
|
|
498
|
+
const r = t, i = new re(s, e || t.name), n = Reflect.getMetadata(P, t);
|
|
499
|
+
n && (i.version = n);
|
|
498
500
|
const c = function(...a) {
|
|
499
|
-
const h = Reflect.construct(r, a), p = Reflect.getMetadata(
|
|
501
|
+
const h = Reflect.construct(r, a), p = Reflect.getMetadata(O, t.prototype);
|
|
500
502
|
if (p) {
|
|
501
503
|
const u = h[p];
|
|
502
|
-
|
|
504
|
+
i.scope = typeof u == "function" ? u.call(h) : u;
|
|
503
505
|
}
|
|
504
|
-
return
|
|
506
|
+
return x.serviceRegistry.register(i, h), h;
|
|
505
507
|
};
|
|
506
508
|
return c.prototype = r.prototype, c;
|
|
507
509
|
};
|
|
@@ -517,12 +519,12 @@ class se {
|
|
|
517
519
|
serviceInstance;
|
|
518
520
|
methodSubscription = null;
|
|
519
521
|
methodMap;
|
|
520
|
-
constructor(e, t, r,
|
|
522
|
+
constructor(e, t, r, i, n = {}) {
|
|
521
523
|
if (!e) throw new Error("ServiceIdentifier must not be null");
|
|
522
524
|
if (!t) throw new Error("Service instance must not be null");
|
|
523
525
|
if (!r) throw new Error("EventBusService must not be null");
|
|
524
|
-
if (!
|
|
525
|
-
this.serviceIdentifier = e, this.serviceInstance = t, this.eventBusService = r, this.interceptorProvider =
|
|
526
|
+
if (!i) throw new Error("interceptorProvider must not be null");
|
|
527
|
+
this.serviceIdentifier = e, this.serviceInstance = t, this.eventBusService = r, this.interceptorProvider = i, this.log = n.logger || te("continuum:ServiceInvocationSupervisor"), this.argumentResolver = n.argumentResolver || new Q(), this.returnValueConverter = n.returnValueConverter || new ee(), this.methodMap = this.buildMethodMap(t);
|
|
526
528
|
}
|
|
527
529
|
isActive() {
|
|
528
530
|
return this.active;
|
|
@@ -552,8 +554,8 @@ class se {
|
|
|
552
554
|
buildMethodMap(e) {
|
|
553
555
|
const t = {};
|
|
554
556
|
for (const r of Object.getOwnPropertyNames(Object.getPrototypeOf(e))) {
|
|
555
|
-
const
|
|
556
|
-
typeof
|
|
557
|
+
const i = e[r];
|
|
558
|
+
typeof i == "function" && r !== "constructor" && (t[r] = i.bind(e));
|
|
557
559
|
}
|
|
558
560
|
return t;
|
|
559
561
|
}
|
|
@@ -573,13 +575,13 @@ class se {
|
|
|
573
575
|
this.log.trace(`Processing control event for correlationId: ${t}`);
|
|
574
576
|
}
|
|
575
577
|
async processInvocationRequest(e) {
|
|
576
|
-
const t =
|
|
578
|
+
const t = C(e.cri).path();
|
|
577
579
|
if (!t)
|
|
578
580
|
throw new Error("The methodId must not be blank");
|
|
579
581
|
const r = this.methodMap[t];
|
|
580
582
|
if (!r)
|
|
581
583
|
throw new Error(`No method resolved for methodId ${t}`);
|
|
582
|
-
const
|
|
584
|
+
const i = t, n = this.argumentResolver.resolveArguments(e), c = Reflect.getMetadata(T, this.serviceInstance, i) || [];
|
|
583
585
|
let a = {};
|
|
584
586
|
const h = this.interceptorProvider();
|
|
585
587
|
if (h)
|
|
@@ -590,13 +592,13 @@ class se {
|
|
|
590
592
|
return;
|
|
591
593
|
}
|
|
592
594
|
for (const l of c)
|
|
593
|
-
|
|
595
|
+
n[l] = a;
|
|
594
596
|
const p = r.length;
|
|
595
|
-
if (
|
|
596
|
-
throw new Error(`Argument count mismatch for method ${t}: expected ${p}, got ${
|
|
597
|
+
if (n.length !== p)
|
|
598
|
+
throw new Error(`Argument count mismatch for method ${t}: expected ${p}, got ${n.length}`);
|
|
597
599
|
let u;
|
|
598
600
|
try {
|
|
599
|
-
u = r(...
|
|
601
|
+
u = r(...n), u instanceof Promise ? u.then(
|
|
600
602
|
(l) => this.processMethodInvocationResult(e, l),
|
|
601
603
|
(l) => this.handleException(e, l)
|
|
602
604
|
) : this.processMethodInvocationResult(e, u);
|
|
@@ -609,7 +611,7 @@ class se {
|
|
|
609
611
|
this.eventBusService.send(r);
|
|
610
612
|
}
|
|
611
613
|
handleException(e, t) {
|
|
612
|
-
const r =
|
|
614
|
+
const r = I.createReplyEvent(
|
|
613
615
|
e.headers,
|
|
614
616
|
/* @__PURE__ */ new Map([
|
|
615
617
|
[o.ERROR_HEADER, t.message || "Unknown error"],
|
|
@@ -624,8 +626,8 @@ class se {
|
|
|
624
626
|
return t ? t.trim() === "" ? (this.log.warn("Reply-to header must not be blank"), !1) : t.startsWith(`${o.SERVICE_DESTINATION_SCHEME}:`) ? !0 : (this.log.warn("Reply-to header must be a valid service destination"), !1) : (this.log.warn("No reply-to header found in event"), !1);
|
|
625
627
|
}
|
|
626
628
|
}
|
|
627
|
-
const
|
|
628
|
-
version:
|
|
629
|
+
const ie = "2.14.8", ne = {
|
|
630
|
+
version: ie
|
|
629
631
|
};
|
|
630
632
|
class oe {
|
|
631
633
|
create(e, t) {
|
|
@@ -633,15 +635,15 @@ class oe {
|
|
|
633
635
|
return r.setHeader(o.CONTENT_TYPE_HEADER, o.CONTENT_JSON), t != null && r.setDataString(JSON.stringify(t)), r;
|
|
634
636
|
}
|
|
635
637
|
}
|
|
636
|
-
class
|
|
638
|
+
class Ye {
|
|
637
639
|
create(e, t) {
|
|
638
640
|
const r = new g(e);
|
|
639
641
|
if (r.setHeader(o.CONTENT_TYPE_HEADER, o.CONTENT_TEXT), t != null) {
|
|
640
|
-
let
|
|
642
|
+
let i = "", n = 0;
|
|
641
643
|
for (const c of t)
|
|
642
|
-
|
|
643
|
-
`),
|
|
644
|
-
|
|
644
|
+
n > 0 && (i = i + `
|
|
645
|
+
`), i = i + c, n++;
|
|
646
|
+
i.length > 0 && r.setDataString(i);
|
|
645
647
|
}
|
|
646
648
|
return r;
|
|
647
649
|
}
|
|
@@ -659,13 +661,13 @@ class ce {
|
|
|
659
661
|
register(e, t) {
|
|
660
662
|
const r = e.cri().raw();
|
|
661
663
|
if (!this.supervisors.has(r)) {
|
|
662
|
-
const
|
|
664
|
+
const i = new se(
|
|
663
665
|
e,
|
|
664
666
|
t,
|
|
665
667
|
this.eventBus,
|
|
666
668
|
() => this.contextInterceptor
|
|
667
669
|
);
|
|
668
|
-
this.supervisors.set(r,
|
|
670
|
+
this.supervisors.set(r, i), i.start();
|
|
669
671
|
}
|
|
670
672
|
}
|
|
671
673
|
unRegister(e) {
|
|
@@ -686,30 +688,30 @@ class ue {
|
|
|
686
688
|
throw new Error("The serviceIdentifier provided must contain a value");
|
|
687
689
|
this.serviceIdentifier = e, this.eventBus = t, this.tracer = b.trace.getTracer(
|
|
688
690
|
"continuum.client",
|
|
689
|
-
|
|
691
|
+
ne.version
|
|
690
692
|
);
|
|
691
693
|
}
|
|
692
|
-
invoke(e, t, r,
|
|
694
|
+
invoke(e, t, r, i) {
|
|
693
695
|
return this.tracer.startActiveSpan(
|
|
694
696
|
`${this.serviceIdentifier}/${e}`,
|
|
695
697
|
{
|
|
696
|
-
kind:
|
|
698
|
+
kind: Y.CLIENT
|
|
697
699
|
},
|
|
698
|
-
async (
|
|
699
|
-
async (c) => (
|
|
700
|
+
async (n) => (r && n.setAttribute("continuum.scope", r), n.setAttribute("rpc.system", "continuum"), n.setAttribute("rpc.service", this.serviceIdentifier), n.setAttribute("rpc.method", e), this.__invokeStream(!1, e, t, r, i).pipe(W()).toPromise().then(
|
|
701
|
+
async (c) => (n.end(), c),
|
|
700
702
|
async (c) => {
|
|
701
|
-
throw
|
|
703
|
+
throw n.recordException(c), n.setStatus({ code: $.ERROR }), n.end(), c;
|
|
702
704
|
}
|
|
703
705
|
))
|
|
704
706
|
);
|
|
705
707
|
}
|
|
706
|
-
invokeStream(e, t, r,
|
|
707
|
-
return this.__invokeStream(!0, e, t, r,
|
|
708
|
+
invokeStream(e, t, r, i) {
|
|
709
|
+
return this.__invokeStream(!0, e, t, r, i);
|
|
708
710
|
}
|
|
709
|
-
__invokeStream(e, t, r,
|
|
710
|
-
const c = o.SERVICE_DESTINATION_PREFIX + (
|
|
711
|
+
__invokeStream(e, t, r, i, n) {
|
|
712
|
+
const c = o.SERVICE_DESTINATION_PREFIX + (i != null ? i + "@" : "") + this.serviceIdentifier + "/" + t;
|
|
711
713
|
let a = ae;
|
|
712
|
-
|
|
714
|
+
n ? a = n : f.getEventFactory() && (a = f.getEventFactory());
|
|
713
715
|
let h = this.eventBus;
|
|
714
716
|
f.getContinuumInstance() && (h = f.getContinuumInstance().eventBus);
|
|
715
717
|
const p = b.trace.getActiveSpan();
|
|
@@ -785,8 +787,8 @@ class le extends _ {
|
|
|
785
787
|
class he extends _ {
|
|
786
788
|
searchText;
|
|
787
789
|
crudServiceProxy;
|
|
788
|
-
constructor(e, t, r,
|
|
789
|
-
super(e, t), this.searchText = r, this.crudServiceProxy =
|
|
790
|
+
constructor(e, t, r, i) {
|
|
791
|
+
super(e, t), this.searchText = r, this.crudServiceProxy = i;
|
|
790
792
|
}
|
|
791
793
|
findNext(e) {
|
|
792
794
|
return this.crudServiceProxy.searchSinglePage(this.searchText, e);
|
|
@@ -922,16 +924,16 @@ class fe {
|
|
|
922
924
|
async execute(e, t) {
|
|
923
925
|
const r = f;
|
|
924
926
|
r.push({ instance: this, eventFactory: t });
|
|
925
|
-
let
|
|
927
|
+
let i;
|
|
926
928
|
try {
|
|
927
|
-
|
|
929
|
+
i = await e();
|
|
928
930
|
} finally {
|
|
929
931
|
r.pop();
|
|
930
932
|
}
|
|
931
|
-
return
|
|
933
|
+
return i;
|
|
932
934
|
}
|
|
933
935
|
}
|
|
934
|
-
const
|
|
936
|
+
const x = new fe();
|
|
935
937
|
var ge = /* @__PURE__ */ ((s) => (s.TRACE = "TRACE", s.DEBUG = "DEBUG", s.INFO = "INFO", s.WARN = "WARN", s.ERROR = "ERROR", s.FATAL = "FATAL", s.OFF = "OFF", s))(ge || {});
|
|
936
938
|
class y {
|
|
937
939
|
configuredLevel;
|
|
@@ -942,7 +944,7 @@ class me extends y {
|
|
|
942
944
|
class ve extends y {
|
|
943
945
|
effectiveLevel;
|
|
944
946
|
}
|
|
945
|
-
class
|
|
947
|
+
class $e {
|
|
946
948
|
levels = [];
|
|
947
949
|
loggerLevels = /* @__PURE__ */ new Map();
|
|
948
950
|
groups = /* @__PURE__ */ new Map();
|
|
@@ -950,29 +952,29 @@ class Ue {
|
|
|
950
952
|
class Se {
|
|
951
953
|
serviceProxy;
|
|
952
954
|
constructor() {
|
|
953
|
-
this.serviceProxy =
|
|
955
|
+
this.serviceProxy = x.serviceProxy("org.kinotic.continuum.api.log.LogManager");
|
|
954
956
|
}
|
|
955
957
|
loggers(e) {
|
|
956
958
|
return this.serviceProxy.invoke("loggers", null, e);
|
|
957
959
|
}
|
|
958
960
|
async loggerLevels(e, t) {
|
|
959
961
|
const r = await this.serviceProxy.invoke("loggerLevels", [t], e);
|
|
960
|
-
let
|
|
961
|
-
return r.hasOwnProperty("members") ?
|
|
962
|
+
let i = null;
|
|
963
|
+
return r.hasOwnProperty("members") ? i = new me() : r.hasOwnProperty("effectiveLevel") ? i = new ve() : i = new y(), Object.assign(i, r), i;
|
|
962
964
|
}
|
|
963
965
|
configureLogLevel(e, t, r) {
|
|
964
966
|
return this.serviceProxy.invoke("configureLogLevel", [t, r], e);
|
|
965
967
|
}
|
|
966
968
|
}
|
|
967
|
-
const
|
|
968
|
-
class
|
|
969
|
+
const Ue = new Se();
|
|
970
|
+
class D extends m {
|
|
969
971
|
constructor(e) {
|
|
970
|
-
super(e), Object.setPrototypeOf(this,
|
|
972
|
+
super(e), Object.setPrototypeOf(this, D.prototype);
|
|
971
973
|
}
|
|
972
974
|
}
|
|
973
|
-
class
|
|
975
|
+
class H extends m {
|
|
974
976
|
constructor(e) {
|
|
975
|
-
super(e), Object.setPrototypeOf(this,
|
|
977
|
+
super(e), Object.setPrototypeOf(this, H.prototype);
|
|
976
978
|
}
|
|
977
979
|
}
|
|
978
980
|
class Ve {
|
|
@@ -985,8 +987,8 @@ class je {
|
|
|
985
987
|
tenantId;
|
|
986
988
|
metadata;
|
|
987
989
|
roles;
|
|
988
|
-
constructor(e, t, r,
|
|
989
|
-
this.id = e, this.tenantId = t, this.metadata = r || /* @__PURE__ */ new Map(), this.roles =
|
|
990
|
+
constructor(e, t, r, i) {
|
|
991
|
+
this.id = e, this.tenantId = t, this.metadata = r || /* @__PURE__ */ new Map(), this.roles = i || [];
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
994
|
class Je {
|
|
@@ -1023,7 +1025,7 @@ class Ge {
|
|
|
1023
1025
|
return "create" in e;
|
|
1024
1026
|
}
|
|
1025
1027
|
}
|
|
1026
|
-
class
|
|
1028
|
+
class L {
|
|
1027
1029
|
/**
|
|
1028
1030
|
* Returns the sorting parameters (optional).
|
|
1029
1031
|
*/
|
|
@@ -1051,7 +1053,7 @@ class M {
|
|
|
1051
1053
|
return new _e(e, t, r);
|
|
1052
1054
|
}
|
|
1053
1055
|
}
|
|
1054
|
-
class Te extends
|
|
1056
|
+
class Te extends L {
|
|
1055
1057
|
/**
|
|
1056
1058
|
* Returns the page to be returned.
|
|
1057
1059
|
*/
|
|
@@ -1066,7 +1068,7 @@ class Te extends M {
|
|
|
1066
1068
|
super(), this.pageNumber = e, this.pageSize = t, this.sort = r;
|
|
1067
1069
|
}
|
|
1068
1070
|
}
|
|
1069
|
-
class _e extends
|
|
1071
|
+
class _e extends L {
|
|
1070
1072
|
/**
|
|
1071
1073
|
* The cursor to be used for subsequent retrieval of data, or null if this is the first page.
|
|
1072
1074
|
*/
|
|
@@ -1107,14 +1109,14 @@ class ze {
|
|
|
1107
1109
|
}
|
|
1108
1110
|
export {
|
|
1109
1111
|
_ as AbstractIterablePage,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
+
D as AuthenticationError,
|
|
1113
|
+
H as AuthorizationError,
|
|
1112
1114
|
T as CONTEXT_METADATA_KEY,
|
|
1113
1115
|
Le as ConnectHeaders,
|
|
1114
1116
|
Ve as ConnectedInfo,
|
|
1115
1117
|
Me as ConnectionInfo,
|
|
1116
1118
|
qe as Context,
|
|
1117
|
-
|
|
1119
|
+
x as Continuum,
|
|
1118
1120
|
f as ContinuumContextStack,
|
|
1119
1121
|
m as ContinuumError,
|
|
1120
1122
|
fe as ContinuumSingleton,
|
|
@@ -1133,11 +1135,11 @@ export {
|
|
|
1133
1135
|
ge as LogLevel,
|
|
1134
1136
|
Se as LogManager,
|
|
1135
1137
|
y as LoggerLevelsDescriptor,
|
|
1136
|
-
|
|
1138
|
+
$e as LoggersDescriptor,
|
|
1137
1139
|
be as NullHandling,
|
|
1138
1140
|
Te as OffsetPageable,
|
|
1139
1141
|
Ke as Order,
|
|
1140
|
-
|
|
1142
|
+
L as Pageable,
|
|
1141
1143
|
je as Participant,
|
|
1142
1144
|
Je as ParticipantConstants,
|
|
1143
1145
|
Fe as Publish,
|
|
@@ -1148,9 +1150,9 @@ export {
|
|
|
1148
1150
|
ze as Sort,
|
|
1149
1151
|
Xe as StreamData,
|
|
1150
1152
|
Re as StreamOperation,
|
|
1151
|
-
|
|
1153
|
+
Ye as TextEventFactory,
|
|
1152
1154
|
Be as Version,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
+
C as createCRI,
|
|
1156
|
+
Ue as logManager
|
|
1155
1157
|
};
|
|
1156
1158
|
//# sourceMappingURL=continuum.js.map
|