@elyx-code/project-logic-tree 0.0.6884 → 0.0.6886

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.
Files changed (4) hide show
  1. package/dist/index.cjs +237 -237
  2. package/dist/index.d.ts +90 -13
  3. package/dist/index.js +50173 -49873
  4. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -10794,12 +10794,14 @@ export declare enum BaseValueDescriptorIds {
10794
10794
  entity: DefinitionEntityState | null;
10795
10795
  query: NestedSearchStatement | null;
10796
10796
  aggregation: AggregationStatement | null;
10797
+ functionCall: FunctionCall | null;
10797
10798
  sourceType: DataSourceType | null;
10799
+ private _asFallback;
10798
10800
  constructor(owner: SearchStatementState);
10799
10801
  get id(): string;
10800
10802
  get type(): SearchStatementNodeType.DataSource;
10801
10803
  get isValid(): boolean;
10802
- get source(): DefinitionEntityState | NestedSearchStatement | AggregationStatement | null;
10804
+ get source(): DefinitionEntityState | NestedSearchStatement | AggregationStatement | FunctionCall | null;
10803
10805
  set as(as: string);
10804
10806
  get as(): string;
10805
10807
  get columns(): ColumnRef[];
@@ -10813,7 +10815,8 @@ export declare enum BaseValueDescriptorIds {
10813
10815
  declare enum DataSourceType {
10814
10816
  Table = "table",
10815
10817
  Query = "query",
10816
- Aggregation = "aggregation"
10818
+ Aggregation = "aggregation",
10819
+ Function = "function"
10817
10820
  }
10818
10821
 
10819
10822
  export declare function dataTypeCompatibilityToErrorExplanation(entityWithValueA: EntityWithValueState, entityWithValueB: EntityWithValueState, compatibility: IDataTypeCompatible | IDataTypeIncompatibile): string;
@@ -14810,7 +14813,7 @@ export declare enum BaseValueDescriptorIds {
14810
14813
 
14811
14814
  export declare const fromNowWithoutSuffixDataTypeParentRef: IValueDescriptorReference;
14812
14815
 
14813
- declare function fromOrderByClauseToSortStatements(orderByClause: OrderByClause, _selectStatement: SelectStmt, _allColumns: IColumnMapping[], state: SearchStatementState): SortStatement[];
14816
+ declare function fromOrderByClauseToSortStatements(orderByClause: OrderByClause, _selectStatement: SelectStmt, _allColumns: IColumnMapping[], state: SearchStatementState, project: ProjectState): SortStatement[];
14814
14817
 
14815
14818
  export declare function fromPublishingDisabledCodeToReadable(code: PUBLISHING_DISABLED_REASONS): string;
14816
14819
 
@@ -14849,19 +14852,22 @@ export declare enum BaseValueDescriptorIds {
14849
14852
 
14850
14853
  declare class FunctionCall implements ISearchNode {
14851
14854
  owner: SearchStatementState;
14852
- functionName: string;
14855
+ private _functionName;
14853
14856
  category: SQLFunctionCategory;
14854
14857
  arguments: FunctionArgument[];
14855
14858
  parent: DataSource | null;
14856
14859
  _id: string;
14857
14860
  _as: string | null;
14858
14861
  constructor(owner: SearchStatementState);
14862
+ set functionName(name: FunctionNames);
14863
+ get functionName(): FunctionNames | '';
14859
14864
  set as(as: string);
14860
14865
  get as(): string;
14861
14866
  get type(): SearchStatementNodeType.FunctionCall;
14862
14867
  get id(): string;
14863
14868
  get isValid(): boolean;
14864
14869
  toQuery(): string;
14870
+ hasFunctionOfCategory(category: SQLFunctionCategory): boolean;
14865
14871
  }
14866
14872
 
14867
14873
  export declare enum FunctionCallDependencyField {
@@ -15226,6 +15232,25 @@ export declare enum BaseValueDescriptorIds {
15226
15232
  }
15227
15233
  export { functionDeclarationValidation }
15228
15234
 
15235
+ declare enum FunctionNames {
15236
+ Upper = "UPPER",
15237
+ Lower = "LOWER",
15238
+ Max = "MAX",
15239
+ Min = "MIN",
15240
+ JsonBuildObject = "json_build_object",
15241
+ RowToJson = "row_to_json",
15242
+ JsonAgg = "json_agg",
15243
+ Count = "COUNT",
15244
+ GenerateSeries = "generate_series",
15245
+ Unnest = "unnest",
15246
+ Coalesce = "COALESCE",
15247
+ Concat = "CONCAT",
15248
+ Sum = "SUM",
15249
+ Length = "LENGTH",
15250
+ Round = "ROUND",
15251
+ Now = "NOW"
15252
+ }
15253
+
15229
15254
  export declare const gdriveSmartFetchActionDescriptorTransfer: IActionDescriptorTransfer;
15230
15255
 
15231
15256
  /** 0) connection (asType external connection entity) */
@@ -18898,6 +18923,8 @@ export declare enum BaseValueDescriptorIds {
18898
18923
  }[];
18899
18924
  };
18900
18925
 
18926
+ declare function getFunctionDefinition(name: FunctionNames): ISQLFunctionDefinition | null;
18927
+
18901
18928
  export declare function getGenerationTargetSchemaBasedOnType(entity: {
18902
18929
  type: EntityType;
18903
18930
  [key: string]: any;
@@ -19013,18 +19040,30 @@ export declare enum BaseValueDescriptorIds {
19013
19040
  type: 'query';
19014
19041
  subquery: SelectStmt;
19015
19042
  as: string;
19043
+ } | {
19044
+ type: 'function';
19045
+ functionCall: Expr;
19046
+ as: string;
19016
19047
  } | null;
19017
19048
 
19018
19049
  declare function getMainSourceNameFromFromClauseExpr(fromExpr: JoinExpr | PivotExpr | UnpivotExpr | TablesampleExpr | ForSystemTimeAsOfExpr | TableFactor, parentExpr?: JoinExpr): {
19019
19050
  type: 'table';
19020
19051
  name: string;
19021
19052
  as: string;
19053
+ } | {
19054
+ type: 'function';
19055
+ functionCall: Expr;
19056
+ as: string;
19022
19057
  } | null;
19023
19058
 
19024
19059
  declare function getMainSourceNameFromSelectStatement(selectStatement: SelectStmt): {
19025
19060
  type: 'table';
19026
19061
  name: string;
19027
19062
  as: string;
19063
+ } | {
19064
+ type: 'function';
19065
+ functionCall: Expr;
19066
+ as: string;
19028
19067
  } | null;
19029
19068
 
19030
19069
  export declare function getMillisecond(input: ISODateString): number;
@@ -23685,6 +23724,21 @@ export declare enum BaseValueDescriptorIds {
23685
23724
 
23686
23725
  export declare function isPromise(obj: any): obj is Promise<any>;
23687
23726
 
23727
+ declare interface ISQLFunctionArgument {
23728
+ name: string;
23729
+ acceptedTypes: SQLDataType[];
23730
+ isVariadic?: boolean;
23731
+ optional?: boolean;
23732
+ }
23733
+
23734
+ declare interface ISQLFunctionDefinition {
23735
+ name: FunctionNames;
23736
+ category: SQLFunctionCategory;
23737
+ description: string;
23738
+ returnType: SQLDataType;
23739
+ arguments: ISQLFunctionArgument[];
23740
+ }
23741
+
23688
23742
  export declare interface ISQLMigrationsDiffs {
23689
23743
  changesSinceLastPublication: boolean;
23690
23744
  rowTransformerNeeded: boolean;
@@ -31856,7 +31910,7 @@ export declare enum BaseValueDescriptorIds {
31856
31910
 
31857
31911
  declare function sanitizeQuery(query: string): string;
31858
31912
 
31859
- declare function sanitizeSQLIdentifierText(text: string): string;
31913
+ declare function sanitizeSQLIdentifierText(text: string): FunctionNames;
31860
31914
 
31861
31915
  export declare type ScopeCompatibility = ICompatibleSameBothLocalScope | ICompatibleSameBothGlobalScope | ICompatibleAInBScope | ICompatibleBInAScope | IIncompatibleParallelInProjectScope | IIncompatibleParallelInCommonParentScope | IIncompatibleAIsGlobalBIsNotScope | IIncompatibleBIsGlobalAIsNotScope;
31862
31916
 
@@ -32080,12 +32134,33 @@ export declare enum BaseValueDescriptorIds {
32080
32134
  getDataType(changeSet?: ChangeSet | null): DataTypeState | null;
32081
32135
  }
32082
32136
 
32137
+ declare namespace searchStatementDefs {
32138
+ export {
32139
+ SearchStatementNodeType,
32140
+ AggregationStatementType,
32141
+ SQLFunctionCategory,
32142
+ SQLDataType,
32143
+ FunctionNames
32144
+ }
32145
+ }
32146
+ export { searchStatementDefs }
32147
+
32083
32148
  export declare const searchStatementErrorGlobalValueDescriptor: IValueDescriptorTransfer;
32084
32149
 
32085
32150
  export declare const searchStatementErrorGlobalValueDescriptorDataType: IDataTypeTransfer;
32086
32151
 
32087
32152
  export declare const searchStatementErrorGlobalValueDescriptorRef: IValueDescriptorReference;
32088
32153
 
32154
+ declare namespace searchStatementFunctions {
32155
+ export {
32156
+ getFunctionDefinition,
32157
+ ISQLFunctionArgument,
32158
+ ISQLFunctionDefinition,
32159
+ SQL_FUNCTION_REGISTRY
32160
+ }
32161
+ }
32162
+ export { searchStatementFunctions }
32163
+
32089
32164
  declare class SearchStatementLiteralValue implements ISearchNode {
32090
32165
  owner: SearchStatementState;
32091
32166
  valueType: SearchLiteralValueType;
@@ -32123,6 +32198,7 @@ export declare enum BaseValueDescriptorIds {
32123
32198
  sorting: SortStatement[];
32124
32199
  dataSources: DataSource[];
32125
32200
  constructor(id: string);
32201
+ get validationErrors(): string[];
32126
32202
  get isUntouchedEntity(): boolean;
32127
32203
  get usedDataSources(): DataSource[];
32128
32204
  get type(): SearchStatementNodeType.SearchStatement;
@@ -32166,10 +32242,7 @@ export declare enum BaseValueDescriptorIds {
32166
32242
  export {
32167
32243
  resolveAreThereConflictingColumnsInSelectAll,
32168
32244
  whereStatementOperatorToSQL,
32169
- SearchStatementNodeType,
32170
32245
  ISearchNode,
32171
- AggregationStatementType,
32172
- SQLFunctionCategory,
32173
32246
  FunctionArgument,
32174
32247
  FunctionCall,
32175
32248
  AggregationStatement,
@@ -32797,7 +32870,7 @@ export declare enum BaseValueDescriptorIds {
32797
32870
 
32798
32871
  declare class SortStatement implements ISearchNode {
32799
32872
  owner: SearchStatementState;
32800
- column: ColumnRef | null;
32873
+ column: ColumnRef | FunctionCall | null;
32801
32874
  direction: SortStatementDirection;
32802
32875
  index: number;
32803
32876
  constructor(owner: SearchStatementState);
@@ -32934,13 +33007,16 @@ export declare enum BaseValueDescriptorIds {
32934
33007
 
32935
33008
  export declare const splitStringAtLastSeparatorOperationStringDataType: IDataTypeTransfer;
32936
33009
 
33010
+ declare const SQL_FUNCTION_REGISTRY: Record<string, ISQLFunctionDefinition>;
33011
+
32937
33012
  export { SQLAST }
32938
33013
 
33014
+ declare type SQLDataType = 'string' | 'number' | 'boolean' | 'date' | 'table' | 'any' | 'json' | 'array';
33015
+
32939
33016
  declare enum SQLFunctionCategory {
32940
33017
  Scalar = "SCALAR",
32941
33018
  Aggregate = "AGGREGATE",
32942
- TableValued = "TABLE_VALUED",
32943
- Window = "WINDOW"
33019
+ TableValued = "TABLE_VALUED"
32944
33020
  }
32945
33021
 
32946
33022
  export declare const sqlRowTransformerBuiltInBaseEntity: IBuiltInBaseEntityTransfer;
@@ -35897,9 +35973,9 @@ export declare enum BaseValueDescriptorIds {
35897
35973
  parent: WhereStatement | null;
35898
35974
  and: WhereStatement[];
35899
35975
  or: WhereStatement[];
35900
- left: ColumnRef | ValueRef | SearchStatementLiteralValue | null;
35976
+ left: ColumnRef | ValueRef | SearchStatementLiteralValue | FunctionCall | null;
35901
35977
  operator: WhereStatementOperator | null;
35902
- right: ColumnRef | ValueRef | SearchStatementLiteralValue | null;
35978
+ right: ColumnRef | ValueRef | SearchStatementLiteralValue | FunctionCall | null;
35903
35979
  _id: string;
35904
35980
  constructor(owner: SearchStatementState, parent?: WhereStatement);
35905
35981
  get type(): SearchStatementNodeType.WhereStatement;
@@ -35910,6 +35986,7 @@ export declare enum BaseValueDescriptorIds {
35910
35986
  sanitize(): void;
35911
35987
  removeFromParent(): void;
35912
35988
  remove(): void;
35989
+ hasFunctionOfCategory(category: SQLFunctionCategory): boolean;
35913
35990
  }
35914
35991
 
35915
35992
  declare enum WhereStatementOperator {