new file: monitoring/node-red/data/.config.nodes.json
new file: monitoring/node-red/data/.config.runtime.json new file: monitoring/node-red/data/.config.runtime.json.backup new file: monitoring/node-red/data/.config.users.json new file: monitoring/node-red/data/.config.users.json.backup new file: monitoring/node-red/data/.flows.json.backup new file: monitoring/node-red/data/.flows_cred.json.backup new file: monitoring/node-red/data/.npm/_cacache/content-v2/sha512/b0/47/c1458664fa9b6a08e9035110b523127a96bd7285d19472dc702f5dc498b927412b0ecd3273708fbf9d61754520599ac0b0e11f3e4c4d4ac784e78d7d97fe new file: monitoring/node-red/data/.npm/_cacache/content-v2/sha512/c2/c2/b64870ea5c5a42b5772106f51123cf684d3c8381de10ccc07d01168d111d0a1ab79ee26fda320b3027c76cfc856119f7b440845a83c9f22d7d731643e62f new file: monitoring/node-red/data/.npm/_cacache/index-v5/15/a4/2638498d877ec2c8c3d88cb9c08d7867c52d3fceb6fc64cc5abde73b01a9 new file: monitoring/node-red/data/.npm/_cacache/index-v5/48/03/b8903b717bbc1ad41b3f37148db48f54e0828c1aef870973f6672895d689 new file: monitoring/node-red/data/.npm/_logs/2026-04-05T01_36_15_515Z-debug-0.log new file: monitoring/node-red/data/context/00b02bbd01c91485/flow.json new file: monitoring/node-red/data/context/global/global.json new file: monitoring/node-red/data/flows.json new file: monitoring/node-red/data/flows_cred.json new file: monitoring/node-red/data/node_modules/.package-lock.json new file: monitoring/node-red/data/node_modules/node-red-debugger/CHANGELOG.md new file: monitoring/node-red/data/node_modules/node-red-debugger/LICENSE new file: monitoring/node-red/data/node_modules/node-red-debugger/README.md new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/flow-debugger.html new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/flow-debugger.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/flow-debugger.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/MessageQueue.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/MessageQueue.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/debugger.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/debugger.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/location.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/location.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/types.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/types.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/locales/en-US/flow-debugger.json new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/locales/ja/flow-debugger.json new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/nr-types.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/nr-types.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/package.json new file: monitoring/node-red/data/node_modules/node-red-debugger/resources/style.css new file: monitoring/node-red/data/package-lock.json new file: monitoring/node-red/data/package.json new file: monitoring/node-red/data/settings.js new file: monitoring/node-red/data/test-container.sh new file: monitoring/node-red/data/test-container.sh.old new file: monitoring/node-red/data/webhook.json
This commit is contained in:
+83
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MessageQueue = void 0;
|
||||
class MessageQueue {
|
||||
constructor(queueName) {
|
||||
this.queueName = queueName;
|
||||
this.previousName = `previousBy${queueName}`;
|
||||
this.nextName = `nextBy${queueName}`;
|
||||
this.length = 0;
|
||||
}
|
||||
enqueue(event) {
|
||||
if (!this.head) {
|
||||
this.head = event;
|
||||
}
|
||||
event[this.previousName] = this.tail;
|
||||
if (this.tail) {
|
||||
this.tail[this.nextName] = event;
|
||||
}
|
||||
this.tail = event;
|
||||
this.length++;
|
||||
}
|
||||
next() {
|
||||
const result = this.head;
|
||||
if (result) {
|
||||
this.remove(result);
|
||||
this.length--;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
peek() {
|
||||
return this.head;
|
||||
}
|
||||
get(id) {
|
||||
let p = this.head;
|
||||
while (p) {
|
||||
if (p.id === id) {
|
||||
return p;
|
||||
}
|
||||
p = p[this.nextName];
|
||||
}
|
||||
}
|
||||
remove(event) {
|
||||
const previousEvent = event[this.previousName];
|
||||
const nextEvent = event[this.nextName];
|
||||
if (previousEvent) {
|
||||
previousEvent[this.nextName] = nextEvent;
|
||||
}
|
||||
else {
|
||||
this.head = nextEvent;
|
||||
}
|
||||
if (nextEvent) {
|
||||
nextEvent[this.previousName] = previousEvent;
|
||||
}
|
||||
else {
|
||||
this.tail = previousEvent;
|
||||
}
|
||||
this.length--;
|
||||
}
|
||||
*[Symbol.iterator]() {
|
||||
let p = this.head;
|
||||
while (p) {
|
||||
yield p;
|
||||
p = p[this.nextName];
|
||||
}
|
||||
}
|
||||
dump() {
|
||||
let result = `MessageQueue ${this.queueName} [${this.length}]
|
||||
head: ${this.head.id}
|
||||
tail: ${this.tail.id}
|
||||
list: `;
|
||||
let p = this.head;
|
||||
while (p) {
|
||||
result = result + p.id;
|
||||
p = p[this.nextName];
|
||||
if (p) {
|
||||
result += " > ";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
exports.MessageQueue = MessageQueue;
|
||||
//# sourceMappingURL=MessageQueue.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MessageQueue.js","sourceRoot":"","sources":["../../src/lib/MessageQueue.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAY;IAQrB,YAAY,SAAgB;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,aAAa,SAAS,EAAE,CAAA;QAC5C,IAAI,CAAC,QAAQ,GAAG,SAAS,SAAS,EAAE,CAAA;QACpC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,KAAkB;QACtB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACZ,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SACrB;QACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QACrC,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;SACpC;QACD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IACD,IAAI;QACA,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;QACzB,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACpB,IAAI,CAAC,MAAM,EAAE,CAAC;SACjB;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,IAAI;QACA,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IACD,GAAG,CAAC,EAAS;QACT,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAClB,OAAM,CAAC,EAAE;YACL,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;gBACb,OAAO,CAAC,CAAC;aACZ;YACD,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvB;IACL,CAAC;IACD,MAAM,CAAC,KAAkB;QACrB,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,aAAa,EAAE;YACf,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;SAC5C;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;SACzB;QACD,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC;SAChD;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;SAC7B;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IACD,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QACd,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAClB,OAAM,CAAC,EAAE;YACL,MAAM,CAAC,CAAC;YACR,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACxB;IACL,CAAC;IACD,IAAI;QACA,IAAI,MAAM,GAAG,gBAAgB,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,MAAM;UACzD,IAAI,CAAC,IAAI,CAAC,EAAE;UACZ,IAAI,CAAC,IAAI,CAAC,EAAE;SACb,CAAC;QACF,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAClB,OAAM,CAAC,EAAE;YACL,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;YACvB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,IAAI,CAAC,EAAE;gBACH,MAAM,IAAI,KAAK,CAAC;aACnB;SACJ;QACD,OAAO,MAAM,CAAA;IAEjB,CAAC;CACJ;AAnFD,oCAmFC"}
|
||||
+370
@@ -0,0 +1,370 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Debugger = void 0;
|
||||
const Location = __importStar(require("./location"));
|
||||
const MessageQueue_1 = require("./MessageQueue");
|
||||
const events_1 = require("events");
|
||||
const DEBUGGER_PAUSED = Symbol("node-red-debugger: paused");
|
||||
let BREAKPOINT_ID = 1;
|
||||
class Debugger extends events_1.EventEmitter {
|
||||
// Events:
|
||||
// paused / resumed
|
||||
constructor(RED) {
|
||||
super();
|
||||
this.config = {
|
||||
breakpointAction: "pause-all"
|
||||
};
|
||||
this.RED = RED;
|
||||
this.enabled = false;
|
||||
this.breakpoints = new Map();
|
||||
this.pausedLocations = new Set();
|
||||
this.breakpointsByLocation = new Map();
|
||||
this.queuesByLocation = {};
|
||||
this.messageQueue = new MessageQueue_1.MessageQueue("Time");
|
||||
this.eventNumber = 0;
|
||||
}
|
||||
log(message) {
|
||||
this.RED.log.info(`[flow-debugger] ${message}`);
|
||||
}
|
||||
checkLocation(location, event, done) {
|
||||
const breakpointId = location.getBreakpointLocation();
|
||||
if (this.isNodePaused(location.id)) {
|
||||
this.queueEvent(location, event, done);
|
||||
}
|
||||
else {
|
||||
if (event.msg && event.msg[DEBUGGER_PAUSED]) {
|
||||
this.pause({
|
||||
reason: "step",
|
||||
node: location.id
|
||||
});
|
||||
this.queueEvent(location, event, done);
|
||||
}
|
||||
else {
|
||||
const bp = this.breakpointsByLocation.get(breakpointId);
|
||||
if (bp && bp.active) {
|
||||
this.pause({
|
||||
reason: "breakpoint",
|
||||
node: location.id,
|
||||
breakpoint: bp.id
|
||||
});
|
||||
this.queueEvent(location, event, done);
|
||||
}
|
||||
else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
enable() {
|
||||
this.log("Enabled");
|
||||
this.enabled = true;
|
||||
this.RED.hooks.add("preRoute.flow-debugger", (sendEvent, done) => {
|
||||
if (isNodeInSubflowModule(sendEvent.source.node)) {
|
||||
// Inside a subflow module - don't pause the event
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (sendEvent.source.node._flow.TYPE !== "flow" && sendEvent.source.node.id === sendEvent.source.node._flow.id) {
|
||||
// This is the subflow output which, in the current implementation
|
||||
// means the message is actually about to be routed to the first node
|
||||
// inside the subflow, not the output of actual subflow.
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (sendEvent.cloneMessage) {
|
||||
sendEvent.msg = this.RED.util.cloneMessage(sendEvent.msg);
|
||||
sendEvent.cloneMessage = false;
|
||||
}
|
||||
const eventLocation = Location.createLocation(sendEvent);
|
||||
// console.log("preRoute",eventLocation.toString());
|
||||
this.checkLocation(eventLocation, sendEvent, done);
|
||||
});
|
||||
this.RED.hooks.add("onReceive.flow-debugger", (receiveEvent, done) => {
|
||||
if (receiveEvent.destination.node.type === "inject") {
|
||||
// Never pause an Inject node's internal receive event
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (isNodeInSubflowModule(receiveEvent.destination.node)) {
|
||||
// Inside a subflow module - don't pause the event
|
||||
done();
|
||||
return;
|
||||
}
|
||||
const eventLocation = Location.createLocation(receiveEvent);
|
||||
// console.log("onReceive",eventLocation.toString());
|
||||
this.checkLocation(eventLocation, receiveEvent, done);
|
||||
});
|
||||
}
|
||||
disable() {
|
||||
this.log("Disabled");
|
||||
this.enabled = false;
|
||||
this.RED.hooks.remove("*.flow-debugger");
|
||||
this.pausedLocations.clear();
|
||||
this.drainQueues(true);
|
||||
}
|
||||
pause(event) {
|
||||
if (this.enabled) {
|
||||
let logReason;
|
||||
if (event) {
|
||||
if (this.config.breakpointAction === "pause-all") {
|
||||
this.pausedLocations.clear();
|
||||
this.pausedLocations.add("*");
|
||||
}
|
||||
else {
|
||||
this.pausedLocations.add(event.node);
|
||||
}
|
||||
if (event.reason === "breakpoint") {
|
||||
logReason = "@" + this.breakpoints.get(event.breakpoint).location.toString();
|
||||
}
|
||||
else if (event.reason === "step") {
|
||||
logReason = "@" + event.node;
|
||||
}
|
||||
event.pausedLocations = [...this.pausedLocations];
|
||||
}
|
||||
else {
|
||||
// Manual pause
|
||||
this.pausedLocations.clear();
|
||||
this.pausedLocations.add("*");
|
||||
logReason = "manual";
|
||||
}
|
||||
this.log(`Flows paused: ${logReason}`);
|
||||
this.emit("paused", event || { reason: "manual" });
|
||||
}
|
||||
}
|
||||
resume(nodeId) {
|
||||
if (this.pausedLocations.size === 0) {
|
||||
return;
|
||||
}
|
||||
if (!nodeId || nodeId === "*") {
|
||||
console.log("resume - clear all locations");
|
||||
this.pausedLocations.clear();
|
||||
}
|
||||
else if (nodeId && this.pausedLocations.has(nodeId)) {
|
||||
this.pausedLocations.delete(nodeId);
|
||||
}
|
||||
else {
|
||||
// Nothing has been unpaused
|
||||
return;
|
||||
}
|
||||
this.log("Flows resumed");
|
||||
this.emit("resumed", { node: nodeId });
|
||||
this.drainQueues();
|
||||
}
|
||||
deleteMessage(messageId) {
|
||||
const nextEvent = this.messageQueue.get(messageId);
|
||||
if (nextEvent) {
|
||||
this.messageQueue.remove(nextEvent);
|
||||
const nextEventLocation = nextEvent.location.toString();
|
||||
this.queuesByLocation[nextEventLocation].remove(nextEvent);
|
||||
const queueDepth = this.queuesByLocation[nextEventLocation].length;
|
||||
if (queueDepth === 0) {
|
||||
delete this.queuesByLocation[nextEventLocation];
|
||||
}
|
||||
this.emit("messageDispatched", { id: nextEvent.id, location: nextEventLocation, depth: queueDepth });
|
||||
// Call done with false to prevent any further processing
|
||||
nextEvent.done(false);
|
||||
}
|
||||
}
|
||||
isNodePaused(nodeId) {
|
||||
return this.pausedLocations.has("*") || this.pausedLocations.has(nodeId);
|
||||
}
|
||||
drainQueues(quiet) {
|
||||
for (const nextEvent of this.messageQueue) {
|
||||
const eventNodeId = nextEvent.location.id;
|
||||
if (!this.isNodePaused(eventNodeId)) {
|
||||
const nextEventLocation = nextEvent.location.toString();
|
||||
this.queuesByLocation[nextEventLocation].remove(nextEvent);
|
||||
const queueDepth = this.queuesByLocation[nextEventLocation].length;
|
||||
if (queueDepth === 0) {
|
||||
delete this.queuesByLocation[nextEventLocation];
|
||||
}
|
||||
if (!quiet) {
|
||||
this.emit("messageDispatched", { id: nextEvent.id, location: nextEventLocation, depth: queueDepth });
|
||||
}
|
||||
if (nextEvent.event.msg[DEBUGGER_PAUSED]) {
|
||||
delete nextEvent.event.msg[DEBUGGER_PAUSED];
|
||||
}
|
||||
nextEvent.done();
|
||||
this.messageQueue.remove(nextEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
setBreakpoint(location) {
|
||||
const bp = {
|
||||
id: (BREAKPOINT_ID++) + "",
|
||||
location,
|
||||
active: true,
|
||||
mode: "all"
|
||||
};
|
||||
this.breakpoints.set(bp.id, bp);
|
||||
this.breakpointsByLocation.set(location.toString(), bp);
|
||||
return bp.id;
|
||||
}
|
||||
getBreakpoint(breakpointId) {
|
||||
return this.breakpoints.get(breakpointId);
|
||||
}
|
||||
setBreakpointActive(breakpointId, state) {
|
||||
const bp = this.breakpoints.get(breakpointId);
|
||||
if (bp) {
|
||||
bp.active = state;
|
||||
}
|
||||
}
|
||||
clearBreakpoint(breakpointId) {
|
||||
const bp = this.breakpoints.get(breakpointId);
|
||||
if (bp) {
|
||||
this.breakpoints.delete(breakpointId);
|
||||
this.breakpointsByLocation.delete(bp.location.toString());
|
||||
}
|
||||
}
|
||||
getBreakpoints() {
|
||||
return Array.from(this.breakpoints.values());
|
||||
}
|
||||
step(messageId) {
|
||||
if (this.enabled) {
|
||||
let nextEvent;
|
||||
if (messageId) {
|
||||
nextEvent = this.messageQueue.get(messageId);
|
||||
if (nextEvent) {
|
||||
this.messageQueue.remove(nextEvent);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nextEvent = this.messageQueue.next();
|
||||
}
|
||||
if (nextEvent) {
|
||||
const nextEventLocation = nextEvent.location.toString();
|
||||
this.log("Step: " + nextEventLocation);
|
||||
this.queuesByLocation[nextEventLocation].remove(nextEvent);
|
||||
const queueDepth = this.queuesByLocation[nextEventLocation].length;
|
||||
if (queueDepth === 0) {
|
||||
delete this.queuesByLocation[nextEventLocation];
|
||||
}
|
||||
nextEvent.event.msg[DEBUGGER_PAUSED] = true;
|
||||
this.emit("messageDispatched", { id: nextEvent.id, location: nextEventLocation, depth: queueDepth });
|
||||
nextEvent.done();
|
||||
}
|
||||
}
|
||||
}
|
||||
setConfig(newConfig) {
|
||||
let changed = false;
|
||||
for (const key in this.config) {
|
||||
if (newConfig.hasOwnProperty(key) && this.config[key] !== newConfig[key]) {
|
||||
changed = true;
|
||||
this.config[key] = newConfig[key];
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
getState() {
|
||||
if (!this.enabled) {
|
||||
return { enabled: false };
|
||||
}
|
||||
return {
|
||||
enabled: true,
|
||||
pausedLocations: [...this.pausedLocations],
|
||||
config: this.config,
|
||||
breakpoints: this.getBreakpoints(),
|
||||
queues: this.getMessageQueueDepths()
|
||||
};
|
||||
}
|
||||
getMessageSummary() {
|
||||
return Array.from(this.messageQueue).map(m => {
|
||||
return {
|
||||
id: m.id,
|
||||
location: m.location
|
||||
};
|
||||
});
|
||||
}
|
||||
getMessageQueue() {
|
||||
return this.messageQueue;
|
||||
}
|
||||
getMessageQueueDepths() {
|
||||
if (!this.enabled) {
|
||||
return {};
|
||||
}
|
||||
const result = {};
|
||||
for (const [locationId, queue] of Object.entries(this.queuesByLocation)) {
|
||||
result[locationId] = { depth: queue.length };
|
||||
}
|
||||
return result;
|
||||
}
|
||||
dump() {
|
||||
let result = `Debugger State
|
||||
---
|
||||
${this.messageQueue.dump()}
|
||||
`;
|
||||
const locationIds = Object.keys(this.queuesByLocation);
|
||||
locationIds.forEach(id => {
|
||||
result += `---
|
||||
Location: ${id}
|
||||
${this.queuesByLocation[id].dump()}
|
||||
`;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
queueEvent(location, event, done) {
|
||||
const locationId = location.toString();
|
||||
if (!this.queuesByLocation[locationId]) {
|
||||
this.queuesByLocation[locationId] = new MessageQueue_1.MessageQueue("Location");
|
||||
}
|
||||
const messageEvent = {
|
||||
id: this.eventNumber++,
|
||||
event,
|
||||
location,
|
||||
done,
|
||||
nextByLocation: null,
|
||||
previousByLocation: null,
|
||||
nextByTime: null,
|
||||
previousByTime: null
|
||||
};
|
||||
this.queuesByLocation[locationId].enqueue(messageEvent);
|
||||
this.messageQueue.enqueue(messageEvent);
|
||||
const queuedEvent = {
|
||||
id: messageEvent.id,
|
||||
location: locationId,
|
||||
msg: event.msg,
|
||||
depth: this.queuesByLocation[locationId].length,
|
||||
destination: null,
|
||||
};
|
||||
if (event.hasOwnProperty('source')) {
|
||||
// SendEvent - so include the destination location id
|
||||
queuedEvent.destination = "/" + event.destination.id + "[i][0]";
|
||||
}
|
||||
this.emit("messageQueued", queuedEvent);
|
||||
}
|
||||
}
|
||||
exports.Debugger = Debugger;
|
||||
const MODULE_TYPE_RE = /^module:/;
|
||||
function isNodeInSubflowModule(node) {
|
||||
let f = node._flow;
|
||||
do {
|
||||
if (f.TYPE === "flow") {
|
||||
return false;
|
||||
}
|
||||
if (MODULE_TYPE_RE.test(f.TYPE)) {
|
||||
return true;
|
||||
}
|
||||
f = f.parent;
|
||||
} while (f && f.TYPE);
|
||||
return false;
|
||||
}
|
||||
//# sourceMappingURL=debugger.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+46
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createLocation = exports.Location = void 0;
|
||||
class Location {
|
||||
constructor(nodeId, nodePath, portType = "o", portIndex = 0) {
|
||||
this.inSubflow = false;
|
||||
this.id = nodeId;
|
||||
this.path = nodePath;
|
||||
this.portType = portType;
|
||||
this.portIndex = portIndex;
|
||||
}
|
||||
getBreakpointLocation() {
|
||||
if (this.inSubflow) {
|
||||
return `*/${this.id}[${this.portType}][${this.portIndex}]`;
|
||||
}
|
||||
else {
|
||||
return this.toString();
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return `${this.path}/${this.id}[${this.portType}][${this.portIndex}]`;
|
||||
}
|
||||
}
|
||||
exports.Location = Location;
|
||||
function createLocation(event) {
|
||||
let node;
|
||||
let portType;
|
||||
let portIndex;
|
||||
if (event.hasOwnProperty("source")) {
|
||||
node = event.source.node;
|
||||
portType = "o";
|
||||
portIndex = event.source.port;
|
||||
}
|
||||
else {
|
||||
node = event.destination.node;
|
||||
portType = "i";
|
||||
portIndex = 0;
|
||||
}
|
||||
const l = new Location(node._alias || node.id, node._flow.path, portType, portIndex);
|
||||
if (node._alias) {
|
||||
l.inSubflow = true;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
exports.createLocation = createLocation;
|
||||
//# sourceMappingURL=location.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/lib/location.ts"],"names":[],"mappings":";;;AAIA,MAAa,QAAQ;IAYjB,YAAY,MAAa,EAAE,QAAe,EAAE,WAAkB,GAAG,EAAE,SAAS,GAAC,CAAC;QAF9E,cAAS,GAAW,KAAK,CAAC;QAGtB,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IACD,qBAAqB;QACjB,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,OAAO,KAAK,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,GAAG,CAAA;SAC7D;aAAM;YACH,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC1B;IACL,CAAC;IACD,QAAQ;QACJ,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,GAAG,CAAA;IACzE,CAAC;CACJ;AA5BD,4BA4BC;AAED,SAAgB,cAAc,CAAC,KAA4B;IACvD,IAAI,IAAQ,CAAC;IACb,IAAI,QAAiB,CAAC;IACtB,IAAI,SAAgB,CAAC;IACrB,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAChC,IAAI,GAAI,KAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,QAAQ,GAAG,GAAG,CAAC;QACf,SAAS,GAAI,KAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;KAChD;SAAM;QACH,IAAI,GAAI,KAAsB,CAAC,WAAW,CAAC,IAAI,CAAC;QAChD,QAAQ,GAAG,GAAG,CAAC;QACf,SAAS,GAAG,CAAC,CAAC;KACjB;IACD,MAAM,CAAC,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrF,IAAI,IAAI,CAAC,MAAM,EAAE;QACb,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;KACtB;IACD,OAAO,CAAC,CAAC;AACb,CAAC;AAlBD,wCAkBC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=types.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":""}
|
||||
Reference in New Issue
Block a user