@elyx-code/project-logic-tree 0.0.6922 → 0.0.6923
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +74 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10644 -10577
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32182,7 +32182,7 @@ export declare enum BaseValueDescriptorIds {
|
|
|
32182
32182
|
SameBothGlobal = "same-both-global"
|
|
32183
32183
|
}
|
|
32184
32184
|
|
|
32185
|
-
export declare const SEARCH_STATEMENT_HYDRATION_EXPLANATION = "The 'query' field of 'search' entities gets stored naivly as pure text, but when we interact with it, it gets just-in-time hydration against the existing project state to become a fully typed SQL AST.\nThis means that you can write any raw SQL query in the 'query' field, and the project checks that any column and table references are actually found in the project.\nSpecifically the names of the 'properties' of any 'definition-entity' that implements the \"persisted\" 'built-in-base-entity' are matched against any columns and tables, respectively, found in the query.\nDefinition entity names are turned into table names by converting them to pascal case. For example \"My new Entity\" turns into \"MyNewEntity\".\nProperty names are turned into column names by converting them to camel case. For example \"My new property\" turns into \"myNewProperty\".\nIf any of the referenced tables or columns aren't found in the project, an error is shown and the referenced is SAFELY removed from the query.\nSame occurs with interpolated values.\nOnly 'input-map' values belonging to the same parent 'search' entity can be used inside the query. Like so: {{::inputMapId}}.\nIf any of the referenced input-maps aren't found in the parent 'search' entity, they will be ignored and SAFELY removed from the query, no errors are shown.\nA query (and therefore a 'search' entity) can only reference tables in a single database, if two 'definition-entities' that implement the \"persisted\" 'built-in-base-entity' belong to two different parent databases, the table selected first will determine what database is being queried, and the other table won't be available for this query.\nIf any of the referenced entities changes, the project will auto-update the query to reflect the changes.\n\nUnfortunately no SQL functions are yet supported, so you can't do `COALESCE()`, `ROUND()`, `NOW()`, `COUNT()` or any other function.";
|
|
32185
|
+
export declare const SEARCH_STATEMENT_HYDRATION_EXPLANATION = "The 'query' field of 'search' entities gets stored naively as pure text, but when we interact with it, it gets just-in-time hydration against the existing project state to become a fully typed SQL AST.\nThis means that you can write any raw SQL query in the 'query' field, and the project checks that any column and table references are actually found in the project.\nSpecifically the names of the 'properties' of any 'definition-entity' that implements the \"persisted\" 'built-in-base-entity' are matched against any columns and tables, respectively, found in the query.\nDefinition entity names are turned into table names by converting them to pascal case. For example \"My new Entity\" turns into \"MyNewEntity\".\nProperty names are turned into column names by converting them to camel case. For example \"My new property\" turns into \"myNewProperty\".\nIf any of the referenced tables or columns aren't found in the project, an error is shown and the reference is SAFELY removed from the query.\nSame occurs with interpolated values.\nOnly 'input-map' values belonging to the same parent 'search' entity can be used inside the query. Like so: {{::inputMapId}}.\nIf any of the referenced input-maps aren't found in the parent 'search' entity, they will be ignored and SAFELY removed from the query, no errors are shown.\nA query (and therefore a 'search' entity) can only reference tables in a single database, if two 'definition-entities' that implement the \"persisted\" 'built-in-base-entity' belong to two different parent databases, the table selected first will determine what database is being queried, and the other table won't be available for this query.\nIf any of the referenced entities changes, the project will auto-update the query to reflect the changes.\n\nSQL DIALECT:\nThe hydrator parses the 'query' string with the SQLite dialect. Use SQLite-compatible syntax \u2014 quoted identifiers use double quotes (\"Employee\", \"myColumn\"), string literals use single quotes ('hello'). The hydrator round-trips through AST \u2192 SQL \u2192 AST every time the query changes, so anything that doesn't survive a SQLite-dialect re-parse will be dropped.\n\nSUPPORTED SQL FUNCTIONS:\nA fixed registry of SQL functions is supported. Anything outside this list is unknown to the hydrator and will be dropped on the next round trip. Do NOT invent functions outside this list (no NOW_UTC(), IF(), IIF(), CASE-as-function, STRFTIME(), DATE_ADD(), LEFT(), RIGHT(), SUBSTRING(), REPLACE(), CAST(), NULLIF(), etc. \u2014 none of those are wired up). Function names are case-insensitive but the canonical casing shown below is what gets re-emitted on round trip.\n\nFunctions belong to one of three categories, and the category determines where the function may legally appear:\n- Scalar: usable anywhere a value is expected (SELECT items, WHERE/ON sides, ORDER BY, LIMIT, OFFSET, function arguments).\n- Aggregate: usable in SELECT items and ORDER BY. NOT allowed directly in WHERE/Filter-Condition expressions \u2014 the validator flags this with \"Aggregate functions (like COUNT or SUM) cannot be used directly in Filter Conditions\". HAVING is not implemented yet, so aggregates can currently only filter via a wrapping subquery.\n- Table-valued (set-returning): usable ONLY as a data source in FROM or JOIN, NEVER as a SELECT item or inside WHERE/ON. The validator emits \"Table-Valued functions (like generate_series or unnest) can only be used as Data Sources (in FROM or JOIN), not in the Output Format\" if misplaced.\n\nScalar functions:\n- UPPER(text) \u2014 string \u2192 string. Uppercase.\n- LOWER(text) \u2014 string \u2192 string. Lowercase.\n- LENGTH(text) \u2014 string \u2192 number. Character count.\n- ROUND(value, decimal_places?) \u2014 number, optional number \u2192 number.\n- NOW() \u2014 no args \u2192 date. Current date/time.\n- COALESCE(value1, value2, ...) \u2014 variadic any \u2192 any. First non-null.\n- CONCAT(str1, str2, ...) \u2014 variadic strings (any-typed args are coerced) \u2192 string.\n- json_build_object(key1, value1, key2, value2, ...) \u2014 variadic alternating key/value pairs \u2192 json.\n- row_to_json(record) \u2014 table/any \u2192 json. Wraps a row as a JSON object.\n\nAggregate functions:\n- COUNT(expression) \u2014 any (column ref or * star selector) \u2192 number.\n- MAX(expression) \u2014 number/date/string \u2192 same type.\n- MIN(expression) \u2014 number/date/string \u2192 same type.\n- SUM(expression) \u2014 number \u2192 number.\n- json_agg(expression) \u2014 any \u2192 json. Aggregates values (including nulls) as a JSON array.\n\nTable-valued / set-returning functions:\n- generate_series(start, stop, step?) \u2014 start/stop are number or date; step is optional number. Must appear in FROM or JOIN.\n- unnest(array) \u2014 variadic any. Expands an array (or JSON-array string \u2014 see \"Array literals\" below) into one row per item. Must appear in FROM or JOIN.\nTable-valued data sources require an alias (AS something) and expose a single column reachable as <alias>.value \u2014 that is the column name to use in SELECT items and ON/WHERE expressions referencing the function's output. Example: LEFT JOIN unnest('[1,2,3]') AS arr ON arr.value > 0, and you'd select it as arr.value AS arrItem.\n\nFunctions can be nested freely as long as argument types match (e.g. UPPER(COALESCE(myCol, 'fallback')), LENGTH(CONCAT('prefix-', myCol)), ROUND(SUM(price), 2)). Argument type-matching is lenient about castable types: UUID, enum, date, and JSON values are accepted where 'string' is expected (they get coerced at the SQL layer), and a 'number' is accepted where 'date' is expected.\n\nLITERAL VALUES INSIDE QUERIES:\nSupported in expressions: strings ('text'), numbers (42, 3.14), booleans (true/false), NULL, dates (ISO-8601 strings), and arrays. Arrays are serialised as a SINGLE-QUOTED JSON-array string for SQLite compatibility \u2014 SQLite has no native array type, so an array literal must be written as e.g. '[1,2,3]' or '[\"a\",\"b\",\"c\"]' and consumed via unnest('[1,2,3]') or similar. Nested arrays ('[[1,2],[3,4]]') are allowed. A literal that fails its own internal validity (e.g. an empty string, or an array with an invalid item) is dropped during hydration the same way a missing column would be.\n\nJOINS AND MERGES:\nAll standard JOIN types are supported: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN, SELF JOIN, NATURAL JOIN. Each JOIN requires an alias on its right-hand data source (... AS Something). For everything except CROSS JOIN and NATURAL JOIN, an ON <condition> clause is required; without one, the JOIN is treated as in-progress and the hydrator falls back to ON 1 = 1 so the SQL stays parseable through the round trip. If you omit the alias, the entire JOIN is dropped silently \u2014 always emit an alias.\n\nData sources for the main FROM and for each JOIN can be:\n1) A table (the PascalCase definition-entity name).\n2) A nested subquery wrapped in parentheses: FROM (SELECT ...) AS aliasName or JOIN (SELECT ...) AS aliasName ON .... Nested subqueries can themselves contain joins and further nested subqueries \u2014 there is no depth limit. Every nested subquery MUST be given an alias; without one the hydrator drops it.\n3) A table-valued function call (see above), which also requires an alias.\n\nA query as a whole \u2014 and any nested subquery \u2014 must have a valid main data source in its FROM clause, otherwise the entire (sub)query is treated as invalid and dropped on the next round trip.\n\nWHERE, ORDER, LIMIT, OFFSET:\nThe query may include a WHERE clause with arbitrary AND/OR nesting using parentheses. Both sides of a comparison can be a column reference, a literal, an input-map interpolation ({{::inputMapId}}), or a scalar/table-valued function-call result (with the category restrictions above). ORDER BY accepts column references and scalar/aggregate function calls and supports ASC/DESC. LIMIT and OFFSET accept either an integer literal or an input-map interpolation.\n\nINTERPOLATION DETAILS:\n{{::inputMapId}} is replaced at runtime with the input-map's resolved value. Strings, numbers, booleans, dates, and JSON-stringified arrays/objects are all supported. The interpolation token is emitted in the SQL as a single-quoted string ('{{::...}}') regardless of the underlying type \u2014 the runtime substitutes the real typed value before execution. Interpolations may appear anywhere a literal could: SELECT items, WHERE/ON sides, ORDER BY, LIMIT, OFFSET, function arguments, etc.\n\nCOLUMN-REFERENCE SYNTAX:\nAlways qualify columns with their source: Employee.id, arr.value, OrgJoin.someColumn. A bare unqualified column name is harder for the hydrator to attribute and may be dropped. For columns coming from a JOIN-aliased subquery, reference them by the JOIN's alias and the subquery's SELECT alias (e.g. if (SELECT User.id AS userId FROM User) AS NestedUser, reference it as NestedUser.userId, not NestedUser.id).\n\nThe SELECT clause should use <source>.<column> AS <outputName> aliasing for every column you want surfaced \u2014 outputs without an AS alias may collide or be dropped. Output aliases must use only letters, numbers, and underscores, must not be SQL reserved keywords, and must be 50 characters or fewer. Duplicate output aliases within the same SELECT are flagged and the duplicates ignored.\n\nVALIDATION RULES TO KEEP IN MIND:\n- A column reference whose PascalCase/camelCase name doesn't exist on the targeted definition-entity is dropped with a 'column not-found' error.\n- A table reference whose PascalCase name doesn't exist (or whose entity doesn't implement the \"persisted\" built-in-base-entity) is dropped with a 'table not-found' error.\n- A JOIN missing either its data source or its alias is dropped.\n- An ON clause referencing columns from outside the JOIN's scope is dropped.\n- Mixing aggregate functions and raw columns in the same SELECT without proper grouping (the \"Giant Bucket\" rule) emits a validation error.\n- Aggregate functions in WHERE / Filter Conditions emit a validation error.\n- Table-valued functions in SELECT / Output Format emit a validation error.";
|
|
32186
32186
|
|
|
32187
32187
|
export declare enum SearchDependencyField {
|
|
32188
32188
|
Parent = "search-parent-field",
|