Aktueller Stand

This commit is contained in:
2026-01-23 01:33:35 +01:00
parent 082dc5e110
commit 2766dd12c5
10109 changed files with 1578841 additions and 77685 deletions

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandWrapper = void 0;
const stringify_1 = require("../../../utils/stringify");
const symbols_1 = require("../../symbols");
class CommandWrapper {
constructor(cmd) {
this.cmd = cmd;
this.hasRan = false;
if ((0, stringify_1.hasToStringMethod)(cmd)) {
const method = cmd[stringify_1.toStringMethod];
this[stringify_1.toStringMethod] = function toStringMethod() {
return method.call(cmd);
};
}
if ((0, stringify_1.hasAsyncToStringMethod)(cmd)) {
const method = cmd[stringify_1.asyncToStringMethod];
this[stringify_1.asyncToStringMethod] = function asyncToStringMethod() {
return method.call(cmd);
};
}
}
check(m) {
return this.cmd.check(m);
}
run(m, r) {
this.hasRan = true;
return this.cmd.run(m, r);
}
clone() {
if ((0, symbols_1.hasCloneMethod)(this.cmd))
return new CommandWrapper(this.cmd[symbols_1.cloneMethod]());
return new CommandWrapper(this.cmd);
}
toString() {
return this.cmd.toString();
}
}
exports.CommandWrapper = CommandWrapper;

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandsIterable = void 0;
const symbols_1 = require("../../symbols");
class CommandsIterable {
constructor(commands, metadataForReplay) {
this.commands = commands;
this.metadataForReplay = metadataForReplay;
}
[Symbol.iterator]() {
return this.commands[Symbol.iterator]();
}
[symbols_1.cloneMethod]() {
return new CommandsIterable(this.commands.map((c) => c.clone()), this.metadataForReplay);
}
toString() {
const serializedCommands = this.commands
.filter((c) => c.hasRan)
.map((c) => c.toString())
.join(',');
const metadata = this.metadataForReplay();
return metadata.length !== 0 ? `${serializedCommands} /*${metadata}*/` : serializedCommands;
}
}
exports.CommandsIterable = CommandsIterable;

View File

@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scheduleCommands = exports.ScheduledCommand = void 0;
class ScheduledCommand {
constructor(s, cmd) {
this.s = s;
this.cmd = cmd;
}
async check(m) {
let error = null;
let checkPassed = false;
const status = await this.s.scheduleSequence([
{
label: `check@${this.cmd.toString()}`,
builder: async () => {
try {
checkPassed = await Promise.resolve(this.cmd.check(m));
}
catch (err) {
error = err;
throw err;
}
},
},
]).task;
if (status.faulty) {
throw error;
}
return checkPassed;
}
async run(m, r) {
let error = null;
const status = await this.s.scheduleSequence([
{
label: `run@${this.cmd.toString()}`,
builder: async () => {
try {
await this.cmd.run(m, r);
}
catch (err) {
error = err;
throw err;
}
},
},
]).task;
if (status.faulty) {
throw error;
}
}
}
exports.ScheduledCommand = ScheduledCommand;
const scheduleCommands = function* (s, cmds) {
for (const cmd of cmds) {
yield new ScheduledCommand(s, cmd);
}
};
exports.scheduleCommands = scheduleCommands;