chore: refactor a little bit

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2026-02-17 10:45:55 +01:00
parent b2b4f06f61
commit 58edede716
5 changed files with 6 additions and 24 deletions
@@ -457,7 +457,7 @@ export class DefaultApiClient {
}
/**
* Query entities using predicate-based filters. This endpoint provides an alternative filtering method with a more expressive filter syntax supporting logical operators ($all, $any, $not) and value operators ($exists, $in). Example query: ```json { \"query\": { \"$all\": [ {\"kind\": \"component\"}, {\"$any\": [ {\"spec.type\": \"service\"}, {\"spec.type\": \"website\"} ]}, {\"$not\": {\"spec.lifecycle\": \"experimental\"}} ] } } ```
* Query entities using predicate-based filters.
* @param queryEntitiesByPredicateRequest -
*/
public async queryEntitiesByPredicate(
@@ -1099,26 +1099,7 @@ paths:
operationId: QueryEntitiesByPredicate
tags:
- Entity
description: |
Query entities using predicate-based filters. This endpoint provides an
alternative filtering method with a more expressive filter syntax supporting
logical operators ($all, $any, $not) and value operators ($exists, $in).
Example query:
```json
{
"query": {
"$all": [
{"kind": "component"},
{"$any": [
{"spec.type": "service"},
{"spec.type": "website"}
]},
{"$not": {"spec.lifecycle": "experimental"}}
]
}
}
```
description: Query entities using predicate-based filters.
responses:
'200':
description: Ok
@@ -1231,8 +1231,7 @@ export const spec = {
post: {
operationId: 'QueryEntitiesByPredicate',
tags: ['Entity'],
description:
'Query entities using predicate-based filters. This endpoint provides an\nalternative filtering method with a more expressive filter syntax supporting\nlogical operators ($all, $any, $not) and value operators ($exists, $in).\n\nExample query:\n```json\n{\n "query": {\n "$all": [\n {"kind": "component"},\n {"$any": [\n {"spec.type": "service"},\n {"spec.type": "website"}\n ]},\n {"$not": {"spec.lifecycle": "experimental"}}\n ]\n }\n}\n```\n',
description: 'Query entities using predicate-based filters.',
responses: {
'200': {
description: 'Ok',
@@ -108,7 +108,7 @@ describe.each(databases.eachSupportedId())(
}
// #endregion
describe.each(strategies)('with strategy %p', _strategy => {
describe.each(strategies)('with strategy %p', strategy => {
async function query(filter: EntityFilter): Promise<string[]> {
const q =
knex<DbFinalEntitiesRow>('final_entities').whereNotNull(
@@ -119,6 +119,7 @@ describe.each(databases.eachSupportedId())(
targetQuery: q,
onEntityIdField: 'final_entities.entity_id',
knex,
strategy,
});
return await q.then(rows =>
rows
@@ -125,6 +125,7 @@ export function applyEntityFilterToQuery(options: {
targetQuery: Knex.QueryBuilder;
onEntityIdField: string;
knex: Knex;
strategy?: 'in' | 'join';
}): Knex.QueryBuilder {
const { filter, query, targetQuery, onEntityIdField, knex } = options;