monsqlize 2.0.0 → 2.0.1
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/CHANGELOG.md +460 -458
- package/README.md +7 -2
- package/changelogs/README.md +141 -138
- package/changelogs/v2.0.0.md +164 -164
- package/changelogs/v2.0.1.md +39 -0
- package/dist/cjs/index.cjs +329 -141
- package/dist/esm/index.mjs +329 -141
- package/dist/types/base.d.ts +81 -81
- package/dist/types/collection.d.ts +973 -973
- package/dist/types/expression.d.ts +115 -115
- package/dist/types/index.d.ts +23 -23
- package/dist/types/model.d.ts +489 -485
- package/dist/types/mongodb.d.ts +49 -49
- package/dist/types/monsqlize.d.ts +429 -429
- package/dist/types/pool.d.ts +84 -84
- package/dist/types/runtime.d.ts +315 -315
- package/dist/types/saga.d.ts +121 -121
- package/dist/types/slow-query-log.d.ts +126 -126
- package/dist/types/sync.d.ts +103 -103
- package/package.json +100 -99
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified expression operator type definitions.
|
|
3
|
-
* @module types/expression
|
|
4
|
-
* @since v1.0.9
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* All 122 expression operators supported by the MonSQLize expression system
|
|
9
|
-
* (100% MongoDB coverage).
|
|
10
|
-
*
|
|
11
|
-
* @since v1.0.9
|
|
12
|
-
*/
|
|
13
|
-
export namespace UnifiedExpressionOperators {
|
|
14
|
-
/** Ternary conditional operator. */
|
|
15
|
-
export type TernaryOperator = '? :';
|
|
16
|
-
|
|
17
|
-
/** Nullish coalescing operator. */
|
|
18
|
-
export type NullishCoalescing = '??';
|
|
19
|
-
|
|
20
|
-
/** Comparison operators. */
|
|
21
|
-
export type ComparisonOperators = '>' | '>=' | '<' | '<=' | '===' | '!==';
|
|
22
|
-
|
|
23
|
-
/** Logical operators. */
|
|
24
|
-
export type LogicalOperators = '&&' | '||' | 'NOT';
|
|
25
|
-
|
|
26
|
-
/** Arithmetic operators. */
|
|
27
|
-
export type ArithmeticOperators = '+' | '-' | '*' | '/' | '%';
|
|
28
|
-
|
|
29
|
-
/** Math functions (8). */
|
|
30
|
-
export type MathFunctions = 'ABS' | 'CEIL' | 'FLOOR' | 'ROUND' | 'SQRT' | 'POW' | 'LOG' | 'LOG10';
|
|
31
|
-
|
|
32
|
-
/** Basic string functions (12). */
|
|
33
|
-
export type StringBasicFunctions =
|
|
34
|
-
| 'CONCAT' | 'UPPER' | 'LOWER' | 'TRIM' | 'SUBSTR' | 'LENGTH'
|
|
35
|
-
| 'SPLIT' | 'REPLACE' | 'INDEX_OF_STR' | 'LTRIM' | 'RTRIM' | 'SUBSTR_CP';
|
|
36
|
-
|
|
37
|
-
/** Extended string functions (3). @since v1.1.0 */
|
|
38
|
-
export type StringExtendedFunctions = 'STR_LEN_BYTES' | 'STR_LEN_CP' | 'SUBSTR_BYTES';
|
|
39
|
-
|
|
40
|
-
/** Basic array functions (10). */
|
|
41
|
-
export type ArrayBasicFunctions =
|
|
42
|
-
| 'SIZE' | 'ARRAY_ELEM_AT' | 'IN' | 'SLICE' | 'FIRST' | 'LAST'
|
|
43
|
-
| 'FILTER' | 'MAP' | 'INDEX_OF' | 'CONCAT_ARRAYS';
|
|
44
|
-
|
|
45
|
-
/** Extended array functions (4). @since v1.1.0 */
|
|
46
|
-
export type ArrayExtendedFunctions = 'REDUCE' | 'ZIP' | 'REVERSE_ARRAY' | 'RANGE';
|
|
47
|
-
|
|
48
|
-
/** Basic date functions (6). */
|
|
49
|
-
export type DateBasicFunctions = 'YEAR' | 'MONTH' | 'DAY_OF_MONTH' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
50
|
-
|
|
51
|
-
/** Advanced date functions (5). @since v1.1.0 */
|
|
52
|
-
export type DateAdvancedFunctions =
|
|
53
|
-
| 'DATE_ADD' | 'DATE_SUBTRACT' | 'DATE_DIFF' | 'DATE_TO_STRING' | 'DATE_FROM_STRING';
|
|
54
|
-
|
|
55
|
-
/** Extended date functions (8). @since v1.1.0 */
|
|
56
|
-
export type DateExtendedFunctions =
|
|
57
|
-
| 'DATE_FROM_PARTS' | 'DATE_TO_PARTS' | 'ISO_WEEK' | 'ISO_WEEK_YEAR'
|
|
58
|
-
| 'ISO_DAY_OF_WEEK' | 'DAY_OF_WEEK' | 'DAY_OF_YEAR' | 'WEEK';
|
|
59
|
-
|
|
60
|
-
/** Type inspection functions (5). */
|
|
61
|
-
export type TypeCheckFunctions = 'TYPE' | 'IS_NUMBER' | 'IS_ARRAY' | 'EXISTS' | 'NOT';
|
|
62
|
-
|
|
63
|
-
/** Basic type conversion functions. */
|
|
64
|
-
export type TypeConversionBasicFunctions = 'TO_INT' | 'TO_STRING' | 'OBJECT_TO_ARRAY' | 'ARRAY_TO_OBJECT';
|
|
65
|
-
|
|
66
|
-
/** Extended type conversion functions (7). @since v1.1.0 */
|
|
67
|
-
export type TypeConversionExtendedFunctions =
|
|
68
|
-
| 'TO_BOOL' | 'TO_DATE' | 'TO_DOUBLE' | 'TO_DECIMAL'
|
|
69
|
-
| 'TO_LONG' | 'TO_OBJECT_ID' | 'CONVERT';
|
|
70
|
-
|
|
71
|
-
/** Logical extended functions (2). @since v1.1.0 */
|
|
72
|
-
export type LogicalExtendedFunctions = 'ALL_ELEMENTS_TRUE' | 'ANY_ELEMENT_TRUE';
|
|
73
|
-
|
|
74
|
-
/** Conditional functions (3). */
|
|
75
|
-
export type ConditionalFunctions = 'SWITCH' | 'COND' | 'IF_NULL';
|
|
76
|
-
|
|
77
|
-
/** Object manipulation functions (5). */
|
|
78
|
-
export type ObjectOperationFunctions =
|
|
79
|
-
| 'MERGE_OBJECTS' | 'SET_FIELD' | 'UNSET_FIELD' | 'GET_FIELD' | 'OBJECT_TO_ARRAY';
|
|
80
|
-
|
|
81
|
-
/** Set operation functions (5). */
|
|
82
|
-
export type SetOperationFunctions =
|
|
83
|
-
| 'SET_UNION' | 'SET_DIFFERENCE' | 'SET_EQUALS' | 'SET_INTERSECTION' | 'SET_IS_SUBSET';
|
|
84
|
-
|
|
85
|
-
/** Advanced operation functions (5). @since v1.1.0 */
|
|
86
|
-
export type AdvancedOperationFunctions = 'LET' | 'LITERAL' | 'RAND' | 'SAMPLE_RATE' | 'REGEX';
|
|
87
|
-
|
|
88
|
-
/** Aggregate accumulator functions (7). */
|
|
89
|
-
export type AggregateFunctions = 'SUM' | 'AVG' | 'MAX' | 'MIN' | 'COUNT' | 'PUSH' | 'ADD_TO_SET';
|
|
90
|
-
|
|
91
|
-
/** Union of all supported operator strings. */
|
|
92
|
-
export type AllOperators =
|
|
93
|
-
| TernaryOperator
|
|
94
|
-
| NullishCoalescing
|
|
95
|
-
| ComparisonOperators
|
|
96
|
-
| LogicalOperators
|
|
97
|
-
| ArithmeticOperators
|
|
98
|
-
| MathFunctions
|
|
99
|
-
| StringBasicFunctions
|
|
100
|
-
| StringExtendedFunctions
|
|
101
|
-
| ArrayBasicFunctions
|
|
102
|
-
| ArrayExtendedFunctions
|
|
103
|
-
| DateBasicFunctions
|
|
104
|
-
| DateAdvancedFunctions
|
|
105
|
-
| DateExtendedFunctions
|
|
106
|
-
| TypeCheckFunctions
|
|
107
|
-
| TypeConversionBasicFunctions
|
|
108
|
-
| TypeConversionExtendedFunctions
|
|
109
|
-
| LogicalExtendedFunctions
|
|
110
|
-
| ConditionalFunctions
|
|
111
|
-
| ObjectOperationFunctions
|
|
112
|
-
| SetOperationFunctions
|
|
113
|
-
| AdvancedOperationFunctions
|
|
114
|
-
| AggregateFunctions;
|
|
115
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Unified expression operator type definitions.
|
|
3
|
+
* @module types/expression
|
|
4
|
+
* @since v1.0.9
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* All 122 expression operators supported by the MonSQLize expression system
|
|
9
|
+
* (100% MongoDB coverage).
|
|
10
|
+
*
|
|
11
|
+
* @since v1.0.9
|
|
12
|
+
*/
|
|
13
|
+
export namespace UnifiedExpressionOperators {
|
|
14
|
+
/** Ternary conditional operator. */
|
|
15
|
+
export type TernaryOperator = '? :';
|
|
16
|
+
|
|
17
|
+
/** Nullish coalescing operator. */
|
|
18
|
+
export type NullishCoalescing = '??';
|
|
19
|
+
|
|
20
|
+
/** Comparison operators. */
|
|
21
|
+
export type ComparisonOperators = '>' | '>=' | '<' | '<=' | '===' | '!==';
|
|
22
|
+
|
|
23
|
+
/** Logical operators. */
|
|
24
|
+
export type LogicalOperators = '&&' | '||' | 'NOT';
|
|
25
|
+
|
|
26
|
+
/** Arithmetic operators. */
|
|
27
|
+
export type ArithmeticOperators = '+' | '-' | '*' | '/' | '%';
|
|
28
|
+
|
|
29
|
+
/** Math functions (8). */
|
|
30
|
+
export type MathFunctions = 'ABS' | 'CEIL' | 'FLOOR' | 'ROUND' | 'SQRT' | 'POW' | 'LOG' | 'LOG10';
|
|
31
|
+
|
|
32
|
+
/** Basic string functions (12). */
|
|
33
|
+
export type StringBasicFunctions =
|
|
34
|
+
| 'CONCAT' | 'UPPER' | 'LOWER' | 'TRIM' | 'SUBSTR' | 'LENGTH'
|
|
35
|
+
| 'SPLIT' | 'REPLACE' | 'INDEX_OF_STR' | 'LTRIM' | 'RTRIM' | 'SUBSTR_CP';
|
|
36
|
+
|
|
37
|
+
/** Extended string functions (3). @since v1.1.0 */
|
|
38
|
+
export type StringExtendedFunctions = 'STR_LEN_BYTES' | 'STR_LEN_CP' | 'SUBSTR_BYTES';
|
|
39
|
+
|
|
40
|
+
/** Basic array functions (10). */
|
|
41
|
+
export type ArrayBasicFunctions =
|
|
42
|
+
| 'SIZE' | 'ARRAY_ELEM_AT' | 'IN' | 'SLICE' | 'FIRST' | 'LAST'
|
|
43
|
+
| 'FILTER' | 'MAP' | 'INDEX_OF' | 'CONCAT_ARRAYS';
|
|
44
|
+
|
|
45
|
+
/** Extended array functions (4). @since v1.1.0 */
|
|
46
|
+
export type ArrayExtendedFunctions = 'REDUCE' | 'ZIP' | 'REVERSE_ARRAY' | 'RANGE';
|
|
47
|
+
|
|
48
|
+
/** Basic date functions (6). */
|
|
49
|
+
export type DateBasicFunctions = 'YEAR' | 'MONTH' | 'DAY_OF_MONTH' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
50
|
+
|
|
51
|
+
/** Advanced date functions (5). @since v1.1.0 */
|
|
52
|
+
export type DateAdvancedFunctions =
|
|
53
|
+
| 'DATE_ADD' | 'DATE_SUBTRACT' | 'DATE_DIFF' | 'DATE_TO_STRING' | 'DATE_FROM_STRING';
|
|
54
|
+
|
|
55
|
+
/** Extended date functions (8). @since v1.1.0 */
|
|
56
|
+
export type DateExtendedFunctions =
|
|
57
|
+
| 'DATE_FROM_PARTS' | 'DATE_TO_PARTS' | 'ISO_WEEK' | 'ISO_WEEK_YEAR'
|
|
58
|
+
| 'ISO_DAY_OF_WEEK' | 'DAY_OF_WEEK' | 'DAY_OF_YEAR' | 'WEEK';
|
|
59
|
+
|
|
60
|
+
/** Type inspection functions (5). */
|
|
61
|
+
export type TypeCheckFunctions = 'TYPE' | 'IS_NUMBER' | 'IS_ARRAY' | 'EXISTS' | 'NOT';
|
|
62
|
+
|
|
63
|
+
/** Basic type conversion functions. */
|
|
64
|
+
export type TypeConversionBasicFunctions = 'TO_INT' | 'TO_STRING' | 'OBJECT_TO_ARRAY' | 'ARRAY_TO_OBJECT';
|
|
65
|
+
|
|
66
|
+
/** Extended type conversion functions (7). @since v1.1.0 */
|
|
67
|
+
export type TypeConversionExtendedFunctions =
|
|
68
|
+
| 'TO_BOOL' | 'TO_DATE' | 'TO_DOUBLE' | 'TO_DECIMAL'
|
|
69
|
+
| 'TO_LONG' | 'TO_OBJECT_ID' | 'CONVERT';
|
|
70
|
+
|
|
71
|
+
/** Logical extended functions (2). @since v1.1.0 */
|
|
72
|
+
export type LogicalExtendedFunctions = 'ALL_ELEMENTS_TRUE' | 'ANY_ELEMENT_TRUE';
|
|
73
|
+
|
|
74
|
+
/** Conditional functions (3). */
|
|
75
|
+
export type ConditionalFunctions = 'SWITCH' | 'COND' | 'IF_NULL';
|
|
76
|
+
|
|
77
|
+
/** Object manipulation functions (5). */
|
|
78
|
+
export type ObjectOperationFunctions =
|
|
79
|
+
| 'MERGE_OBJECTS' | 'SET_FIELD' | 'UNSET_FIELD' | 'GET_FIELD' | 'OBJECT_TO_ARRAY';
|
|
80
|
+
|
|
81
|
+
/** Set operation functions (5). */
|
|
82
|
+
export type SetOperationFunctions =
|
|
83
|
+
| 'SET_UNION' | 'SET_DIFFERENCE' | 'SET_EQUALS' | 'SET_INTERSECTION' | 'SET_IS_SUBSET';
|
|
84
|
+
|
|
85
|
+
/** Advanced operation functions (5). @since v1.1.0 */
|
|
86
|
+
export type AdvancedOperationFunctions = 'LET' | 'LITERAL' | 'RAND' | 'SAMPLE_RATE' | 'REGEX';
|
|
87
|
+
|
|
88
|
+
/** Aggregate accumulator functions (7). */
|
|
89
|
+
export type AggregateFunctions = 'SUM' | 'AVG' | 'MAX' | 'MIN' | 'COUNT' | 'PUSH' | 'ADD_TO_SET';
|
|
90
|
+
|
|
91
|
+
/** Union of all supported operator strings. */
|
|
92
|
+
export type AllOperators =
|
|
93
|
+
| TernaryOperator
|
|
94
|
+
| NullishCoalescing
|
|
95
|
+
| ComparisonOperators
|
|
96
|
+
| LogicalOperators
|
|
97
|
+
| ArithmeticOperators
|
|
98
|
+
| MathFunctions
|
|
99
|
+
| StringBasicFunctions
|
|
100
|
+
| StringExtendedFunctions
|
|
101
|
+
| ArrayBasicFunctions
|
|
102
|
+
| ArrayExtendedFunctions
|
|
103
|
+
| DateBasicFunctions
|
|
104
|
+
| DateAdvancedFunctions
|
|
105
|
+
| DateExtendedFunctions
|
|
106
|
+
| TypeCheckFunctions
|
|
107
|
+
| TypeConversionBasicFunctions
|
|
108
|
+
| TypeConversionExtendedFunctions
|
|
109
|
+
| LogicalExtendedFunctions
|
|
110
|
+
| ConditionalFunctions
|
|
111
|
+
| ObjectOperationFunctions
|
|
112
|
+
| SetOperationFunctions
|
|
113
|
+
| AdvancedOperationFunctions
|
|
114
|
+
| AggregateFunctions;
|
|
115
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export * from './base';
|
|
2
|
-
export * from './collection';
|
|
3
|
-
export * from './expression';
|
|
4
|
-
export * from './lock';
|
|
5
|
-
export * from './model';
|
|
6
|
-
export * from './mongodb';
|
|
7
|
-
export * from './pool';
|
|
8
|
-
export * from './runtime';
|
|
9
|
-
export * from './saga';
|
|
10
|
-
export * from './slow-query-log';
|
|
11
|
-
export * from './sync';
|
|
12
|
-
export * from './transaction';
|
|
13
|
-
export * from './monsqlize';
|
|
14
|
-
|
|
15
|
-
export { default, MonSQLize } from './monsqlize';
|
|
16
|
-
export { Model, generateQueryHash, validateSyncConfig } from './runtime';
|
|
17
|
-
|
|
18
|
-
export type { Lock as LockContract } from './lock';
|
|
19
|
-
export type { ModelInstance as ModelAccessor, ModelInstance } from './model';
|
|
20
|
-
export type { SyncTargetConfig as SyncTarget } from './sync';
|
|
21
|
-
export type { Transaction as TransactionContract } from './transaction';
|
|
22
|
-
export type { MonSQLizeOptions as BaseOptions } from './monsqlize';
|
|
23
|
-
|
|
1
|
+
export * from './base';
|
|
2
|
+
export * from './collection';
|
|
3
|
+
export * from './expression';
|
|
4
|
+
export * from './lock';
|
|
5
|
+
export * from './model';
|
|
6
|
+
export * from './mongodb';
|
|
7
|
+
export * from './pool';
|
|
8
|
+
export * from './runtime';
|
|
9
|
+
export * from './saga';
|
|
10
|
+
export * from './slow-query-log';
|
|
11
|
+
export * from './sync';
|
|
12
|
+
export * from './transaction';
|
|
13
|
+
export * from './monsqlize';
|
|
14
|
+
|
|
15
|
+
export { default, MonSQLize } from './monsqlize';
|
|
16
|
+
export { Model, generateQueryHash, validateSyncConfig } from './runtime';
|
|
17
|
+
|
|
18
|
+
export type { Lock as LockContract } from './lock';
|
|
19
|
+
export type { ModelInstance as ModelAccessor, ModelInstance } from './model';
|
|
20
|
+
export type { SyncTargetConfig as SyncTarget } from './sync';
|
|
21
|
+
export type { Transaction as TransactionContract } from './transaction';
|
|
22
|
+
export type { MonSQLizeOptions as BaseOptions } from './monsqlize';
|
|
23
|
+
|