@platforma-open/milaboratories.software-ptabler.schema 1.11.2 → 1.11.4

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 (66) hide show
  1. package/dist/aggregate.d.ts +2 -1
  2. package/dist/aggregate.d.ts.map +1 -0
  3. package/dist/basic_steps.d.ts +30 -35
  4. package/dist/basic_steps.d.ts.map +1 -0
  5. package/dist/common.d.ts +1 -0
  6. package/dist/common.d.ts.map +1 -0
  7. package/dist/concatenate.d.ts +1 -0
  8. package/dist/concatenate.d.ts.map +1 -0
  9. package/dist/expressions/base.d.ts +6 -0
  10. package/dist/expressions/base.d.ts.map +1 -0
  11. package/dist/expressions/basics.d.ts +131 -0
  12. package/dist/expressions/basics.d.ts.map +1 -0
  13. package/dist/expressions/conditional.d.ts +56 -0
  14. package/dist/expressions/conditional.d.ts.map +1 -0
  15. package/dist/expressions/fuzzy.d.ts +45 -0
  16. package/dist/expressions/fuzzy.d.ts.map +1 -0
  17. package/dist/expressions/hash.d.ts +25 -0
  18. package/dist/expressions/hash.d.ts.map +1 -0
  19. package/dist/expressions/index.d.ts +25 -0
  20. package/dist/expressions/index.d.ts.map +1 -0
  21. package/dist/expressions/pframes.d.ts +34 -0
  22. package/dist/expressions/pframes.d.ts.map +1 -0
  23. package/dist/expressions/selectors.d.ts +172 -0
  24. package/dist/expressions/selectors.d.ts.map +1 -0
  25. package/dist/expressions/string.d.ts +158 -0
  26. package/dist/expressions/string.d.ts.map +1 -0
  27. package/dist/expressions/struct.d.ts +37 -0
  28. package/dist/expressions/struct.d.ts.map +1 -0
  29. package/dist/expressions/window.d.ts +52 -0
  30. package/dist/expressions/window.d.ts.map +1 -0
  31. package/dist/index.cjs +3 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.ts +10 -7
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +1 -1
  36. package/dist/io.d.ts +16 -1
  37. package/dist/io.d.ts.map +1 -0
  38. package/dist/join.d.ts +1 -0
  39. package/dist/join.d.ts.map +1 -0
  40. package/dist/read_frame.d.ts +26 -0
  41. package/dist/read_frame.d.ts.map +1 -0
  42. package/dist/sort.d.ts +2 -1
  43. package/dist/sort.d.ts.map +1 -0
  44. package/dist/write_frame.d.ts +58 -0
  45. package/dist/write_frame.d.ts.map +1 -0
  46. package/package.json +9 -7
  47. package/src/basic_steps.ts +32 -37
  48. package/src/expressions/base.ts +5 -0
  49. package/src/expressions/basics.ts +163 -0
  50. package/src/expressions/conditional.ts +59 -0
  51. package/src/expressions/fuzzy.ts +51 -0
  52. package/src/expressions/hash.ts +37 -0
  53. package/src/expressions/index.ts +143 -0
  54. package/src/expressions/pframes.ts +35 -0
  55. package/src/expressions/selectors.ts +203 -0
  56. package/src/expressions/string.ts +168 -0
  57. package/src/expressions/struct.ts +37 -0
  58. package/src/expressions/window.ts +66 -0
  59. package/src/index.ts +26 -3
  60. package/src/io.ts +16 -0
  61. package/src/read_frame.ts +26 -0
  62. package/src/write_frame.ts +66 -0
  63. package/dist/expressions.d.ts +0 -457
  64. package/dist/index.mjs +0 -2
  65. package/dist/index.mjs.map +0 -1
  66. package/src/expressions.ts +0 -569
@@ -1,4 +1,4 @@
1
- import { Expression, AggregationType } from './expressions';
1
+ import type { Expression, AggregationType } from './expressions';
2
2
  /**
3
3
  * Defines aggregation functions that select a value from one expression based on the min/max of another expression.
4
4
  */
@@ -53,3 +53,4 @@ export interface AggregateStep {
53
53
  /** An array of aggregation operations to apply to the input table. */
54
54
  aggregations: (StandardAggregationOperation | ByClauseAggregationOperation)[];
55
55
  }
56
+ //# sourceMappingURL=aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../src/aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,EAAE,eAAe,CAAC;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,WAAW,EAAE,uBAAuB,CAAC;IACrC,8CAA8C;IAC9C,UAAU,EAAE,UAAU,CAAC;IACvB;;;OAGG;IACH,EAAE,EAAE,UAAU,EAAE,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,IAAI,EAAE,WAAW,CAAC;IAClB,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;IACpB,kGAAkG;IAClG,OAAO,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IACjC,sEAAsE;IACtE,YAAY,EAAE,CAAC,4BAA4B,GAAG,4BAA4B,CAAC,EAAE,CAAC;CAC/E"}
@@ -1,4 +1,4 @@
1
- import { Expression } from './expressions';
1
+ import type { Expression } from './expressions';
2
2
  /**
3
3
  * Defines a step that adds one or more new columns to an existing table in the tablespace.
4
4
  * This operation modifies the specified table in place.
@@ -17,17 +17,7 @@ export interface AddColumnsStep {
17
17
  * An array defining the new columns to be added.
18
18
  * Each object in the array specifies the name of a new column and the expression to compute its values.
19
19
  */
20
- columns: {
21
- /**
22
- * The name of the new column.
23
- */
24
- name: string;
25
- /**
26
- * An Expression object defining how to compute the column's values.
27
- * The expression will be evaluated for each row to generate the values for the new column.
28
- */
29
- expression: Expression;
30
- }[];
20
+ columns: Expression[];
31
21
  }
32
22
  /**
33
23
  * Defines a step that filters rows in a table based on a specified condition
@@ -81,18 +71,7 @@ export interface SelectStep {
81
71
  * Each object in the array specifies the name of a column in the output table
82
72
  * and the expression to compute its values.
83
73
  */
84
- columns: {
85
- /**
86
- * The name of the column in the output table.
87
- */
88
- name: string;
89
- /**
90
- * An Expression object defining how to compute the column's values.
91
- * This expression will be evaluated to generate the values for this column
92
- * in the output table.
93
- */
94
- expression: Expression;
95
- }[];
74
+ columns: Expression[];
96
75
  }
97
76
  /**
98
77
  * Defines a step that adds new columns to an input table (or replaces existing ones
@@ -121,17 +100,7 @@ export interface WithColumnsStep {
121
100
  * Each object in the array specifies the name of a column and the
122
101
  * expression to compute its values.
123
102
  */
124
- columns: {
125
- /**
126
- * The name of the new or replacement column.
127
- */
128
- name: string;
129
- /**
130
- * An Expression object defining how to compute the column's values.
131
- * The expression will be evaluated for each row to generate the values for the column.
132
- */
133
- expression: Expression;
134
- }[];
103
+ columns: Expression[];
135
104
  }
136
105
  /**
137
106
  * Defines a step that excludes a specific set of columns from an input table
@@ -158,3 +127,29 @@ export interface WithoutColumnsStep {
158
127
  */
159
128
  columns: string[];
160
129
  }
130
+ /**
131
+ * Defines a step that limits the number of rows in a table
132
+ * and outputs the result to a new table in the tablespace.
133
+ * This operation is similar to Polars' `limit` method.
134
+ */
135
+ export interface LimitStep {
136
+ /**
137
+ * The type identifier for this step.
138
+ * Must be 'limit'.
139
+ */
140
+ type: 'limit';
141
+ /**
142
+ * The name of the input table in the tablespace from which rows will be limited.
143
+ */
144
+ inputTable: string;
145
+ /**
146
+ * The name for the resulting table that will be added to the tablespace.
147
+ * This new table will contain only the first n rows from the input table.
148
+ */
149
+ outputTable: string;
150
+ /**
151
+ * The maximum number of rows to include in the output table.
152
+ */
153
+ n: number;
154
+ }
155
+ //# sourceMappingURL=basic_steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic_steps.d.ts","sourceRoot":"","sources":["../src/basic_steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE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AE,MAAM,CAAC;IAEpB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACX"}
package/dist/common.d.ts CHANGED
@@ -8,3 +8,4 @@
8
8
  * - 'Double': maps to 'Float64'
9
9
  */
10
10
  export type DataType = 'Int8' | 'Int16' | 'Int32' | 'Int64' | 'UInt8' | 'UInt16' | 'UInt32' | 'UInt64' | 'Float32' | 'Float64' | 'Boolean' | 'String' | 'Date' | 'Datetime' | 'Time' | 'Int' | 'Long' | 'Float' | 'Double';
11
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,UAAU,GACV,MAAM,GAEN,KAAK,GACL,MAAM,GACN,OAAO,GACP,QAAQ,CAAC"}
@@ -20,3 +20,4 @@ export interface ConcatenateStep {
20
20
  */
21
21
  columns?: string[];
22
22
  }
23
+ //# sourceMappingURL=concatenate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concatenate.d.ts","sourceRoot":"","sources":["../src/concatenate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Forward declaration of the Expression type.
3
+ * The real type is defined in [index.ts](./index.ts) file to avoid circular dependencies.
4
+ */
5
+ export { type Expression } from './index';
6
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/expressions/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,131 @@
1
+ import type { AxisSpec } from '@milaboratories/pl-model-common';
2
+ import type { DataType } from '../common';
3
+ import type { Expression } from './base';
4
+ /** Represents all possible comparison operator types. */
5
+ export type ComparisonOperator = 'gt' | 'ge' | 'eq' | 'lt' | 'le' | 'neq';
6
+ /** Defines a comparison operation between two expressions. */
7
+ export interface ComparisonExpression {
8
+ /** The type of comparison (e.g., 'gt', 'eq'). */
9
+ type: ComparisonOperator;
10
+ /** The left-hand side expression. */
11
+ lhs: Expression;
12
+ /** The right-hand side expression. */
13
+ rhs: Expression;
14
+ }
15
+ /** Defines the supported binary arithmetic operators. */
16
+ export type BinaryArithmeticOperator = 'plus' | 'minus' | 'multiply' | 'truediv' | 'floordiv';
17
+ /** Represents a binary arithmetic operation between two expressions. */
18
+ export interface BinaryArithmeticExpression {
19
+ /** The type of arithmetic operation (e.g., 'plus', 'minus'). */
20
+ type: BinaryArithmeticOperator;
21
+ /** The left-hand side expression. */
22
+ lhs: Expression;
23
+ /** The right-hand side expression. */
24
+ rhs: Expression;
25
+ }
26
+ /** Defines the supported unary arithmetic operators. */
27
+ export type UnaryArithmeticOperator = 'log10' | 'log' | 'log2' | 'abs' | 'sqrt' | 'negate' | 'floor' | 'round' | 'ceil';
28
+ /** Represents a unary arithmetic operation on a single expression. */
29
+ export interface UnaryArithmeticExpression {
30
+ /** The type of unary operation (e.g., 'log10', 'abs'). */
31
+ type: UnaryArithmeticOperator;
32
+ /** The expression to operate on. */
33
+ value: Expression;
34
+ }
35
+ /**
36
+ * Represents a type casting operation that converts the result of an expression to a specified data type.
37
+ */
38
+ export interface CastExpression {
39
+ /** The type of operation, always 'cast'. */
40
+ type: 'cast';
41
+ /** The expression whose result will be cast to the target data type. */
42
+ value: Expression;
43
+ /** The target data type to cast the expression result to. */
44
+ dtype: DataType;
45
+ /**
46
+ * Whether to use strict casting mode. If true, conversion errors and overflows will throw exceptions.
47
+ * If false or undefined, uses non-strict mode where failures result in null values. Defaults to false.
48
+ */
49
+ strict?: boolean;
50
+ }
51
+ /** Defines the supported boolean list operators. */
52
+ export type BooleanListOperator = 'and' | 'or';
53
+ /** Represents a boolean logic operation (AND, OR) on a list of expressions. */
54
+ export interface BooleanLogicExpression {
55
+ /** The type of boolean operation ('and', 'or'). */
56
+ type: BooleanListOperator;
57
+ /** An array of boolean expressions as operands. */
58
+ operands: Expression[];
59
+ }
60
+ /** Represents a logical NOT operation on a single boolean expression. */
61
+ export interface NotExpression {
62
+ /** The type of operation, always 'not'. */
63
+ type: 'not';
64
+ /** The boolean expression to negate. */
65
+ value: Expression;
66
+ }
67
+ /** Defines the supported null check operators. */
68
+ export type NullCheckOperator = 'is_na' | 'is_not_na';
69
+ /** Represents a null check operation (is NA, is not NA) on an expression. */
70
+ export interface NullCheckExpression {
71
+ /** The type of null check ('is_na', 'is_not_na'). */
72
+ type: NullCheckOperator;
73
+ /** The expression to check for nullity. */
74
+ value: Expression;
75
+ }
76
+ /** Represents a reference to a column by its name. */
77
+ export interface ColumnReferenceExpression {
78
+ /** The type of operation, always 'col'. */
79
+ type: 'col';
80
+ /** The name of the column to reference. */
81
+ name: string;
82
+ }
83
+ /** Represents a reference to an axis by its specification (or id). */
84
+ export interface AxisReferenceExpression {
85
+ /** The type of operation, always 'axis'. */
86
+ type: 'axis';
87
+ /** The axis to reference. */
88
+ spec: AxisSpec;
89
+ }
90
+ /** Represents a constant literal value (string, number, boolean, or null). */
91
+ export interface ConstantValueExpression {
92
+ /** The type of operation, always 'const'. */
93
+ type: 'const';
94
+ /** The constant value. */
95
+ value: string | number | boolean | null;
96
+ }
97
+ /** Defines the supported min/max operators. */
98
+ export type MinMaxOperator = 'min' | 'max';
99
+ /** Represents a min or max operation on a list of expressions. */
100
+ export interface MinMaxExpression {
101
+ /** The type of operation ('min' or 'max'). */
102
+ type: MinMaxOperator;
103
+ /** An array of expressions to find the minimum or maximum value from. */
104
+ operands: Expression[];
105
+ }
106
+ /**
107
+ * Represents an "in set" operation.
108
+ * Checks if the value of an expression is contained within a specified set of values.
109
+ * Returns true if the expression's value is found in the set, false otherwise.
110
+ */
111
+ export interface InSetExpression {
112
+ /** The type of operation, always 'in_set'. */
113
+ type: 'in_set';
114
+ /** The expression whose value will be checked for membership in the set. */
115
+ value: Expression;
116
+ /** The set of values to check membership against. */
117
+ set: (string | number | boolean | null)[];
118
+ }
119
+ /**
120
+ * Represents an alias operation.
121
+ * This operation creates a new expression with a specified alias.
122
+ */
123
+ export interface AliasExpression {
124
+ /** The type of operation, always 'alias'. */
125
+ type: 'alias';
126
+ /** The expression to alias. */
127
+ value: Expression;
128
+ /** The alias name. */
129
+ name: string;
130
+ }
131
+ //# sourceMappingURL=basics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basics.d.ts","sourceRoot":"","sources":["../../src/expressions/basics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE1E,8DAA8D;AAC9D,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,IAAI,EAAE,kBAAkB,CAAC;IACzB,qCAAqC;IACrC,GAAG,EAAE,UAAU,CAAC;IAChB,sCAAsC;IACtC,GAAG,EAAE,UAAU,CAAC;CACjB;AAED,yDAAyD;AACzD,MAAM,MAAM,wBAA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single "when" condition and its corresponding "then" result expression.
4
+ * Used within the WhenThenOtherwiseExpression.
5
+ */
6
+ export interface WhenThenClause {
7
+ /** The condition expression. Should evaluate to a boolean. */
8
+ when: Expression;
9
+ /** The result expression if the 'when' condition is true. */
10
+ then: Expression;
11
+ }
12
+ /**
13
+ * Represents a conditional expression that evaluates a series of "when"
14
+ * conditions and returns the corresponding "then" expression's value.
15
+ * If no "when" condition is met, it returns the value of the "otherwise" expression.
16
+ * This mimics Polars' when/then/otherwise functionality.
17
+ */
18
+ export interface WhenThenOtherwiseExpression {
19
+ /** The type of operation, always 'when_then_otherwise'. */
20
+ type: 'when_then_otherwise';
21
+ /** An array of "when/then" clauses to be evaluated in order. */
22
+ conditions: WhenThenClause[];
23
+ /** The expression whose value is returned if none of the "when" conditions are met. */
24
+ otherwise: Expression;
25
+ }
26
+ /**
27
+ * Represents a fill null operation.
28
+ * If the 'input' expression evaluates to null, the 'fillValue' expression is used.
29
+ * Otherwise, the 'input' expression's value is used.
30
+ * This is a convenience shortcut for a common pattern often implemented with
31
+ * conditional expressions (e.g., when(is_null(input), fillValue).otherwise(input)).
32
+ */
33
+ export interface FillNullExpression {
34
+ /** The type of operation, always 'fill_null'. */
35
+ type: 'fill_null';
36
+ /** The primary expression to evaluate. */
37
+ input: Expression;
38
+ /** The expression whose value is used if 'input' is null. */
39
+ fillValue: Expression;
40
+ }
41
+ /**
42
+ * Represents a fill NaN operation.
43
+ * If the 'input' expression evaluates to NaN, the 'fillValue' expression is used.
44
+ * Otherwise, the 'input' expression's value is used.
45
+ * This is a convenience shortcut for a common pattern often implemented with
46
+ * conditional expressions (e.g., when(is_nan(input), fillValue).otherwise(input)).
47
+ */
48
+ export interface FillNaNExpression {
49
+ /** The type of operation, always 'fill_nan'. */
50
+ type: 'fill_nan';
51
+ /** The primary expression to evaluate. */
52
+ input: Expression;
53
+ /** The expression whose value is used if 'input' is NaN. */
54
+ fillValue: Expression;
55
+ }
56
+ //# sourceMappingURL=conditional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../src/expressions/conditional.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,IAAI,EAAE,UAAU,CAAC;IACjB,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,2DAA2D;IAC3D,IAAI,EAAE,qBAAqB,CAAC;IAC5B,gEAAgE;IAChE,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,uFAAuF;IACvF,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC;IAClB,0CAA0C;IAC1C,KAAK,EAAE,UAAU,CAAC;IAClB,6DAA6D;IAC7D,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,IAAI,EAAE,UAAU,CAAC;IACjB,0CAA0C;IAC1C,KAAK,EAAE,UAAU,CAAC;IAClB,4DAA4D;IAC5D,SAAS,EAAE,UAAU,CAAC;CACvB"}
@@ -0,0 +1,45 @@
1
+ import type { Expression } from './base';
2
+ /** Defines the supported string distance metrics. */
3
+ export type StringDistanceMetric = 'levenshtein' | 'optimal_string_alignment' | 'jaro_winkler';
4
+ /**
5
+ * Represents a string distance/similarity calculation between two expressions.
6
+ * Computes metrics like Levenshtein, Optimal String Alignment, or Jaro-Winkler.
7
+ */
8
+ export interface StringDistanceExpression {
9
+ /** The type of operation, always 'string_distance'. */
10
+ type: 'string_distance';
11
+ /** The specific distance metric to use. */
12
+ metric: StringDistanceMetric;
13
+ /** The first string expression. */
14
+ string1: Expression;
15
+ /** The second string expression to compare against. */
16
+ string2: Expression;
17
+ /**
18
+ * If true, the expression returns a similarity score (typically normalized between 0 and 1).
19
+ * If false or undefined, it returns the raw edit distance (e.g., Levenshtein, OSA).
20
+ * Jaro-Winkler inherently returns a similarity score; this flag might be ignored or influence its normalization if applicable.
21
+ */
22
+ returnSimilarity?: boolean;
23
+ }
24
+ /** Defines the supported fuzzy string filter distance metrics. */
25
+ export type FuzzyFilterDistanceMetric = 'levenshtein' | 'hamming';
26
+ /**
27
+ * Represents a fuzzy string filter operation on an expression.
28
+ * This operation compares the string value of an expression (`value`)
29
+ * against another string or string expression (`pattern`) using a specified
30
+ * distance metric (`levenshtein` or `hamming`), returning true if the distance is
31
+ * within the specified `bound`.
32
+ */
33
+ export interface FuzzyStringFilterExpression {
34
+ /** The type of operation, always 'fuzzy_string_filter'. */
35
+ type: 'fuzzy_string_filter';
36
+ /** The distance metric to use for the fuzzy comparison. */
37
+ metric: FuzzyFilterDistanceMetric;
38
+ /** The expression whose string value will be compared. */
39
+ value: Expression;
40
+ /** The expression representing the string pattern to compare against. */
41
+ pattern: Expression;
42
+ /** The maximum allowed distance for a match (inclusive). */
43
+ bound: number;
44
+ }
45
+ //# sourceMappingURL=fuzzy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuzzy.d.ts","sourceRoot":"","sources":["../../src/expressions/fuzzy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,qDAAqD;AACrD,MAAM,MAAM,oBAAoB,GAC5B,aAAa,GACb,0BAA0B,GAC1B,cAAc,CAAC;AAEnB;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,IAAI,EAAE,iBAAiB,CAAC;IACxB,2CAA2C;IAC3C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,mCAAmC;IACnC,OAAO,EAAE,UAAU,CAAC;IACpB,uDAAuD;IACvD,OAAO,EAAE,UAAU,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,kEAAkE;AAClE,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG,SAAS,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,2DAA2D;IAC3D,IAAI,EAAE,qBAAqB,CAAC;IAC5B,2DAA2D;IAC3D,MAAM,EAAE,yBAAyB,CAAC;IAClC,0DAA0D;IAC1D,KAAK,EAAE,UAAU,CAAC;IAClB,yEAAyE;IACzE,OAAO,EAAE,UAAU,CAAC;IACpB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,25 @@
1
+ import type { Expression } from './base';
2
+ /** Defines the supported hash types. Includes common cryptographic and non-cryptographic algorithms. */
3
+ export type HashType = 'sha256' | 'sha512' | 'md5' | 'blake3' | 'wyhash' | 'xxh3';
4
+ /**
5
+ * Defines the encoding for the hash output.
6
+ * - 'hex': Standard hexadecimal encoding.
7
+ * - 'base64': Standard base64 encoding.
8
+ * - 'base64_alphanumeric': Base64 encoding with non-alphanumeric characters (e.g., '+', '/') removed.
9
+ * - 'base64_alphanumeric_upper': Base64 encoding with non-alphanumeric characters removed and the result converted to uppercase.
10
+ */
11
+ export type HashEncoding = 'hex' | 'base64' | 'base64_alphanumeric' | 'base64_alphanumeric_upper';
12
+ /** Represents a hashing operation on an expression. */
13
+ export interface HashExpression {
14
+ /** The specific type of hash algorithm to apply. */
15
+ type: 'hash';
16
+ /** The type of hash algorithm to apply. */
17
+ hashType: HashType;
18
+ /** The encoding for the output hash string. */
19
+ encoding: HashEncoding;
20
+ /** The expression whose value will be hashed. */
21
+ value: Expression;
22
+ /** Optional. Minimal number of entropy bits required. Affects encoding, truncating the result to the shortest string with the requested entropy. No error if bits exceed what the hash offers. */
23
+ bits?: number;
24
+ }
25
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/expressions/hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,wGAAwG;AACxG,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,MAAM,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,QAAQ,GACR,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,YAAY,CAAC;IACvB,iDAAiD;IACjD,KAAK,EAAE,UAAU,CAAC;IAClB,kMAAkM;IAClM,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,25 @@
1
+ export * from './base';
2
+ export * from './basics';
3
+ export * from './selectors';
4
+ export * from './string';
5
+ export * from './fuzzy';
6
+ export * from './conditional';
7
+ export * from './window';
8
+ export * from './hash';
9
+ export * from './struct';
10
+ export * from './pframes';
11
+ import type { ComparisonExpression, BinaryArithmeticExpression, UnaryArithmeticExpression, CastExpression, BooleanLogicExpression, NotExpression, NullCheckExpression, ColumnReferenceExpression, AxisReferenceExpression, ConstantValueExpression, MinMaxExpression, InSetExpression, AliasExpression } from './basics';
12
+ import type { AllSelectorExpression, StringSelectorExpression, NumericSelectorExpression, IntegerSelectorExpression, FloatSelectorExpression, StartsWithSelectorExpression, EndsWithSelectorExpression, ContainsSelectorExpression, MatchesSelectorExpression, ExcludeSelectorExpression, ByNameSelectorExpression, AxisSelectorExpression, NestedSelectorExpression, SelectorComplementExpression, SelectorUnionExpression, SelectorIntersectionExpression, SelectorDifferenceExpression, SelectorSymmetricDifferenceExpression } from './selectors';
13
+ import type { StringJoinExpression, ExtendedUnaryStringExpression, SubstringExpression, StringReplaceExpression, StringContainsExpression, StringStartsWithExpression, StringEndsWithExpression, StringContainsAnyExpression, StringCountMatchesExpression, StringExtractExpression } from './string';
14
+ import type { StringDistanceExpression, FuzzyStringFilterExpression } from './fuzzy';
15
+ import type { WhenThenOtherwiseExpression, FillNullExpression, FillNaNExpression } from './conditional';
16
+ import type { RankExpression, CumsumExpression, WindowExpression } from './window';
17
+ import type { HashExpression } from './hash';
18
+ import type { StructFieldExpression } from './struct';
19
+ import type { MatchesEcmaRegexExpression, ContainsFuzzyMatchExpression } from './pframes';
20
+ /**
21
+ * Represents all possible expression types in the system.
22
+ * This is the main union type that includes all concrete expression implementations.
23
+ */
24
+ export type Expression = ComparisonExpression | BinaryArithmeticExpression | UnaryArithmeticExpression | CastExpression | BooleanLogicExpression | NotExpression | NullCheckExpression | StringJoinExpression | HashExpression | ColumnReferenceExpression | AxisReferenceExpression | ConstantValueExpression | RankExpression | CumsumExpression | ExtendedUnaryStringExpression | StringDistanceExpression | FuzzyStringFilterExpression | WhenThenOtherwiseExpression | SubstringExpression | StringReplaceExpression | StringContainsExpression | StringStartsWithExpression | StringEndsWithExpression | StringContainsAnyExpression | StringCountMatchesExpression | StringExtractExpression | MinMaxExpression | FillNullExpression | FillNaNExpression | WindowExpression | StructFieldExpression | MatchesEcmaRegexExpression | ContainsFuzzyMatchExpression | InSetExpression | AliasExpression | AllSelectorExpression | StringSelectorExpression | NumericSelectorExpression | IntegerSelectorExpression | FloatSelectorExpression | StartsWithSelectorExpression | EndsWithSelectorExpression | ContainsSelectorExpression | MatchesSelectorExpression | ExcludeSelectorExpression | ByNameSelectorExpression | AxisSelectorExpression | NestedSelectorExpression | SelectorComplementExpression | SelectorUnionExpression | SelectorIntersectionExpression | SelectorDifferenceExpression | SelectorSymmetricDifferenceExpression;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expressions/index.ts"],"names":[],"mappings":"A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AE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,oBAAoB,GACpB,0BAA0B,GAC1B,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,aAAa,GACb,mBAAmB,GACnB,oBAAoB,GACpB,cAAc,GACd,yBAAyB,GACzB,uBAAuB,GACvB,uBAAuB,GACvB,cAAc,GACd,gBAAgB,GAChB,6BAA6B,GAC7B,wBAAwB,GACxB,2BAA2B,GAC3B,2BAA2B,GAC3B,mBAAmB,GACnB,uBAAuB,GACvB,wBAAwB,GACxB,0BAA0B,GAC1B,wBAAwB,GACxB,2BAA2B,GAC3B,4BAA4B,GAC5B,uBAAuB,GACvB,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,0BAA0B,GAC1B,4BAA4B,GAC5B,eAAe,GACf,eAAe,GACf,qBAAqB,GACrB,wBAAwB,GACxB,yBAAyB,GACzB,yBAAyB,GACzB,uBAAuB,GACvB,4BAA4B,GAC5B,0BAA0B,GAC1B,0BAA0B,GAC1B,yBAAyB,GACzB,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,GACtB,wBAAwB,GACxB,4BAA4B,GAC5B,uBAAuB,GACvB,8BAA8B,GAC9B,4BAA4B,GAC5B,qCAAqC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { Expression } from './base';
2
+ /**
3
+ * Represents a regex matching operation using ECMAScript regular expressions.
4
+ * Takes a string expression as input and returns a boolean indicating if the input value
5
+ * matches the provided ECMAScript regular expression.
6
+ */
7
+ export interface MatchesEcmaRegexExpression {
8
+ /** The type of operation, always 'matches_ecma_regex'. */
9
+ type: 'matches_ecma_regex';
10
+ /** The string expression whose value will be compared. */
11
+ value: Expression;
12
+ /** The ECMAScript regular expression to match against. */
13
+ ecma_regex: string;
14
+ }
15
+ /**
16
+ * Represents a fuzzy string matching operation.
17
+ * Takes a string expression as input and returns a boolean indicating if the input value
18
+ * contains a close match to the provided reference string.
19
+ */
20
+ export interface ContainsFuzzyMatchExpression {
21
+ /** The type of operation, always 'contains_fuzzy_match'. */
22
+ type: 'contains_fuzzy_match';
23
+ /** The string expression whose value will be compared. */
24
+ value: Expression;
25
+ /** The string reference to compare against. */
26
+ reference: string;
27
+ /** The maximum number of edits allowed to be considered a match. */
28
+ max_edits: number;
29
+ /** The wildcard character to use. */
30
+ wildcard?: string;
31
+ /** If true, only substitutions are allowed (deletions and insertions are also allowed by default). */
32
+ substitutions_only?: boolean;
33
+ }
34
+ //# sourceMappingURL=pframes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pframes.d.ts","sourceRoot":"","sources":["../../src/expressions/pframes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,0DAA0D;IAC1D,IAAI,EAAE,oBAAoB,CAAC;IAC3B,0DAA0D;IAC1D,KAAK,EAAE,UAAU,CAAC;IAClB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,4DAA4D;IAC5D,IAAI,EAAE,sBAAsB,CAAC;IAC7B,0DAA0D;IAC1D,KAAK,EAAE,UAAU,CAAC;IAClB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}