TenantAtlas/apps/platform/.pnpm-store/v10/files/bf/eeff1bfd885007c2c3739b66b99c485f42301bd1c7af21336c05d439257e678ddacc687fba792c0bb73abeaf5dd89acde6b0a5003cc4c952ec1bc1dd94616e
ahmido 1fec9c6f9d
Some checks failed
Main Confidence / confidence (push) Failing after 45s
feat: compress governance operator outcomes (#253)
## 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
2026-04-19 12:30:36 +00:00

223 lines
6.6 KiB
Plaintext

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var conditions_exports = {};
__export(conditions_exports, {
and: () => and,
arrayContained: () => arrayContained,
arrayContains: () => arrayContains,
arrayOverlaps: () => arrayOverlaps,
between: () => between,
bindIfParam: () => bindIfParam,
eq: () => eq,
exists: () => exists,
gt: () => gt,
gte: () => gte,
ilike: () => ilike,
inArray: () => inArray,
isNotNull: () => isNotNull,
isNull: () => isNull,
like: () => like,
lt: () => lt,
lte: () => lte,
ne: () => ne,
not: () => not,
notBetween: () => notBetween,
notExists: () => notExists,
notIlike: () => notIlike,
notInArray: () => notInArray,
notLike: () => notLike,
or: () => or
});
module.exports = __toCommonJS(conditions_exports);
var import_column = require("../../column.cjs");
var import_entity = require("../../entity.cjs");
var import_table = require("../../table.cjs");
var import_sql = require("../sql.cjs");
function bindIfParam(value, column) {
if ((0, import_sql.isDriverValueEncoder)(column) && !(0, import_sql.isSQLWrapper)(value) && !(0, import_entity.is)(value, import_sql.Param) && !(0, import_entity.is)(value, import_sql.Placeholder) && !(0, import_entity.is)(value, import_column.Column) && !(0, import_entity.is)(value, import_table.Table) && !(0, import_entity.is)(value, import_sql.View)) {
return new import_sql.Param(value, column);
}
return value;
}
const eq = (left, right) => {
return import_sql.sql`${left} = ${bindIfParam(right, left)}`;
};
const ne = (left, right) => {
return import_sql.sql`${left} <> ${bindIfParam(right, left)}`;
};
function and(...unfilteredConditions) {
const conditions = unfilteredConditions.filter(
(c) => c !== void 0
);
if (conditions.length === 0) {
return void 0;
}
if (conditions.length === 1) {
return new import_sql.SQL(conditions);
}
return new import_sql.SQL([
new import_sql.StringChunk("("),
import_sql.sql.join(conditions, new import_sql.StringChunk(" and ")),
new import_sql.StringChunk(")")
]);
}
function or(...unfilteredConditions) {
const conditions = unfilteredConditions.filter(
(c) => c !== void 0
);
if (conditions.length === 0) {
return void 0;
}
if (conditions.length === 1) {
return new import_sql.SQL(conditions);
}
return new import_sql.SQL([
new import_sql.StringChunk("("),
import_sql.sql.join(conditions, new import_sql.StringChunk(" or ")),
new import_sql.StringChunk(")")
]);
}
function not(condition) {
return import_sql.sql`not ${condition}`;
}
const gt = (left, right) => {
return import_sql.sql`${left} > ${bindIfParam(right, left)}`;
};
const gte = (left, right) => {
return import_sql.sql`${left} >= ${bindIfParam(right, left)}`;
};
const lt = (left, right) => {
return import_sql.sql`${left} < ${bindIfParam(right, left)}`;
};
const lte = (left, right) => {
return import_sql.sql`${left} <= ${bindIfParam(right, left)}`;
};
function inArray(column, values) {
if (Array.isArray(values)) {
if (values.length === 0) {
return import_sql.sql`false`;
}
return import_sql.sql`${column} in ${values.map((v) => bindIfParam(v, column))}`;
}
return import_sql.sql`${column} in ${bindIfParam(values, column)}`;
}
function notInArray(column, values) {
if (Array.isArray(values)) {
if (values.length === 0) {
return import_sql.sql`true`;
}
return import_sql.sql`${column} not in ${values.map((v) => bindIfParam(v, column))}`;
}
return import_sql.sql`${column} not in ${bindIfParam(values, column)}`;
}
function isNull(value) {
return import_sql.sql`${value} is null`;
}
function isNotNull(value) {
return import_sql.sql`${value} is not null`;
}
function exists(subquery) {
return import_sql.sql`exists ${subquery}`;
}
function notExists(subquery) {
return import_sql.sql`not exists ${subquery}`;
}
function between(column, min, max) {
return import_sql.sql`${column} between ${bindIfParam(min, column)} and ${bindIfParam(
max,
column
)}`;
}
function notBetween(column, min, max) {
return import_sql.sql`${column} not between ${bindIfParam(
min,
column
)} and ${bindIfParam(max, column)}`;
}
function like(column, value) {
return import_sql.sql`${column} like ${value}`;
}
function notLike(column, value) {
return import_sql.sql`${column} not like ${value}`;
}
function ilike(column, value) {
return import_sql.sql`${column} ilike ${value}`;
}
function notIlike(column, value) {
return import_sql.sql`${column} not ilike ${value}`;
}
function arrayContains(column, values) {
if (Array.isArray(values)) {
if (values.length === 0) {
throw new Error("arrayContains requires at least one value");
}
const array = import_sql.sql`${bindIfParam(values, column)}`;
return import_sql.sql`${column} @> ${array}`;
}
return import_sql.sql`${column} @> ${bindIfParam(values, column)}`;
}
function arrayContained(column, values) {
if (Array.isArray(values)) {
if (values.length === 0) {
throw new Error("arrayContained requires at least one value");
}
const array = import_sql.sql`${bindIfParam(values, column)}`;
return import_sql.sql`${column} <@ ${array}`;
}
return import_sql.sql`${column} <@ ${bindIfParam(values, column)}`;
}
function arrayOverlaps(column, values) {
if (Array.isArray(values)) {
if (values.length === 0) {
throw new Error("arrayOverlaps requires at least one value");
}
const array = import_sql.sql`${bindIfParam(values, column)}`;
return import_sql.sql`${column} && ${array}`;
}
return import_sql.sql`${column} && ${bindIfParam(values, column)}`;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
and,
arrayContained,
arrayContains,
arrayOverlaps,
between,
bindIfParam,
eq,
exists,
gt,
gte,
ilike,
inArray,
isNotNull,
isNull,
like,
lt,
lte,
ne,
not,
notBetween,
notExists,
notIlike,
notInArray,
notLike,
or
});
//# sourceMappingURL=conditions.cjs.map