Some checks failed
Main Confidence / confidence (push) Failing after 45s
## Summary - introduce surface-aware compressed governance outcomes and reuse the shared truth/explanation seams for operator-first summaries - apply the compressed outcome hierarchy across baseline, evidence, review, review-pack, canonical review/evidence, and artifact-oriented operation-run surfaces - expand spec 214 fixtures and Pest coverage, and fix tenant-panel route assertions by generating explicit tenant-panel URLs in the affected Filament tests ## Validation - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - focused governance compression suite from `specs/214-governance-outcome-compression/quickstart.md` passed (`68` tests, `445` assertions) - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/InventoryItemResourceTest.php tests/Feature/Filament/BackupSetUiEnforcementTest.php tests/Feature/Filament/RestoreRunUiEnforcementTest.php` passed (`18` tests, `81` assertions) Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #253
74 lines
3.1 KiB
Plaintext
74 lines
3.1 KiB
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.windowTime = void 0;
|
|
var Subject_1 = require("../Subject");
|
|
var async_1 = require("../scheduler/async");
|
|
var Subscription_1 = require("../Subscription");
|
|
var lift_1 = require("../util/lift");
|
|
var OperatorSubscriber_1 = require("./OperatorSubscriber");
|
|
var arrRemove_1 = require("../util/arrRemove");
|
|
var args_1 = require("../util/args");
|
|
var executeSchedule_1 = require("../util/executeSchedule");
|
|
function windowTime(windowTimeSpan) {
|
|
var _a, _b;
|
|
var otherArgs = [];
|
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
otherArgs[_i - 1] = arguments[_i];
|
|
}
|
|
var scheduler = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler;
|
|
var windowCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
|
|
var maxWindowSize = otherArgs[1] || Infinity;
|
|
return lift_1.operate(function (source, subscriber) {
|
|
var windowRecords = [];
|
|
var restartOnClose = false;
|
|
var closeWindow = function (record) {
|
|
var window = record.window, subs = record.subs;
|
|
window.complete();
|
|
subs.unsubscribe();
|
|
arrRemove_1.arrRemove(windowRecords, record);
|
|
restartOnClose && startWindow();
|
|
};
|
|
var startWindow = function () {
|
|
if (windowRecords) {
|
|
var subs = new Subscription_1.Subscription();
|
|
subscriber.add(subs);
|
|
var window_1 = new Subject_1.Subject();
|
|
var record_1 = {
|
|
window: window_1,
|
|
subs: subs,
|
|
seen: 0,
|
|
};
|
|
windowRecords.push(record_1);
|
|
subscriber.next(window_1.asObservable());
|
|
executeSchedule_1.executeSchedule(subs, scheduler, function () { return closeWindow(record_1); }, windowTimeSpan);
|
|
}
|
|
};
|
|
if (windowCreationInterval !== null && windowCreationInterval >= 0) {
|
|
executeSchedule_1.executeSchedule(subscriber, scheduler, startWindow, windowCreationInterval, true);
|
|
}
|
|
else {
|
|
restartOnClose = true;
|
|
}
|
|
startWindow();
|
|
var loop = function (cb) { return windowRecords.slice().forEach(cb); };
|
|
var terminate = function (cb) {
|
|
loop(function (_a) {
|
|
var window = _a.window;
|
|
return cb(window);
|
|
});
|
|
cb(subscriber);
|
|
subscriber.unsubscribe();
|
|
};
|
|
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) {
|
|
loop(function (record) {
|
|
record.window.next(value);
|
|
maxWindowSize <= ++record.seen && closeWindow(record);
|
|
});
|
|
}, function () { return terminate(function (consumer) { return consumer.complete(); }); }, function (err) { return terminate(function (consumer) { return consumer.error(err); }); }));
|
|
return function () {
|
|
windowRecords = null;
|
|
};
|
|
});
|
|
}
|
|
exports.windowTime = windowTime;
|
|
//# sourceMappingURL=windowTime.js.map |